Click here to Skip to main content
14,297,835 members
Rate this:
Please Sign up or sign in to vote.
See more:
I am trying to query a datatable via LINQ and my code is as follows - after reading on the google.

var result = from c in ods.Tables[0].AsEnumerable()
select new { c.Field<string> ("name")};



My problem is, i needs to import
system.data.datasetextensions
for this code to work, I was able to add the reference to this dll.

But when i do using System.Data, i do not get the datasetextensions name space options.


Kindly help me...am learning
Posted
Rate this:
Please Sign up or sign in to vote.

Solution 1

You need to have both the dll reference added, and to put: Using System.Data; in your project.

You are using .NET 3.5 or later ... right ?
   
Comments
nokia6300 9-Oct-11 17:39pm
   
thank you, i got it right now
Rate this:
Please Sign up or sign in to vote.

Solution 2

Try following the instruction in this MSDN article How to: Create a LINQ to DataSet Project In Visual Studio[^].
   
Comments
nokia6300 9-Oct-11 17:39pm
   
Thank you

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100