Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Datagrid populated by LINQ not editable

Posted on 2013-10-26
3
Medium Priority
?
370 Views
Last Modified: 2016-02-10
I have a LINQ query that I use to populate a datagrid. When I fill grid I cannot change any of the cells.  I know I will need specific query to change my actual table, but changing the grid has never been an issue for me.  Here is LINQ query.

Dim curScores = From s In db.Schedules
Join t1 In db.Teams On s.HomeID Equals t1.Teamid
Join t2 In db.Teams On s.AwayID Equals t2.Teamid
Where s.Week = Me.tscboWeeks.Text And s.Season = "2014"
Select s.id, HId = s.HomeID, Home = t1.TeamName, s.HScore,
AId = s.AwayID, Away = t2.TeamName, s.AScore
0
Comment
Question by:Break40
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 66

Assisted Solution

by:Jim Horn
Jim Horn earned 1500 total points
ID: 39602776
<Wild guess>
Make sure the LINQ query is editable in the first place, as queries with multiple JOINs often are not editable.
0
 

Accepted Solution

by:
Break40 earned 0 total points
ID: 39602802
Solved it myself.
First I had to change select statement to SELECT NEW With {.....}.  Then to use aliases with my columns I had to add a . in front of each alias column name I wanted to use.  
For example .HomeTeam = t1.teamname
0
 

Author Closing Comment

by:Break40
ID: 39613559
It actually explains how to do it.
0

Featured Post

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question