Solved

Datagrid populated by LINQ not editable

Posted on 2013-10-26
3
346 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
  • 2
3 Comments
 
LVL 65

Assisted Solution

by:Jim Horn
Jim Horn earned 500 total points
Comment Utility
<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
Comment Utility
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
Comment Utility
It actually explains how to do it.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
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…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
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.

763 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now