Click here to Skip to main content
15,909,030 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am trying to query a datatable via LINQ and my code is as follows - after reading on the google.

C#
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

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 ?
 
Share this answer
 
Comments
nokia6300 9-Oct-11 17:39pm    
thank you, i got it right now
Try following the instruction in this MSDN article How to: Create a LINQ to DataSet Project In Visual Studio[^].
 
Share this answer
 
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, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900