Advertisement

03.19.2008 at 08:45PM PDT, ID: 23255884
[x]
Attachment Details

C# LINQ Query Loading DataGridView VS 2008 Windows Form App

Asked by ImInOrlando in Language Integrated Query - LINQ, C# Programming Language, .NET Framework 3.x versions

My Project: Windows Form App written in C# VS2008
I am seeking some advice and possible example for the following dilemma. I am new to Linq To Sql and Linq To DataSet and I am trying to find the best straightforward way to fill a DataGridView by using a Linq query and possibly Stored Procedures later.

I have read various posts on using var and IEnumerable return datatypes and what I am simply trying to do to no avail is basically "Select * From TableName". My initial approach was to fill the DataGridView with a DataTable and I think I have learned that Linq To Sql will not return back a DataTable list from a query, only a list of Objects of type IEnumerable<Object>. My DB Table contains various datatype values for the fields (int, string etc). So, once we receive the list of IEnumerable objects, do we tuck a DataTable into a DataSet and then load the IEnumerable objects into the DataTable and the bind the DataGridView to a BindingSource control? I'm confused and lost, can someone help assist me? Start Free Trial
[+][-]03.19.2008 at 11:20PM PDT, ID: 21168705

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.20.2008 at 05:43PM PDT, ID: 21177197

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Language Integrated Query - LINQ, C# Programming Language, .NET Framework 3.x versions
Sign Up Now!
Solution Provided By: ImInOrlando
Participating Experts: 2
Solution Grade: A
 
 
[+][-]03.21.2008 at 08:29AM PDT, ID: 21180586

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.17.2008 at 09:05PM PDT, ID: 21383224

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628