Page 1 of 1

LINQ to typedDataSet

Posted: Tue 08 Jun 2010 16:40
by degas
The generated DataSet by DevArt cannot be used with LINQ? Or is there a way to generated a LINQ-enabled TypedDataSet

Posted: Thu 10 Jun 2010 13:24
by AndreyR
You can use LINQ to DataSet with strongly-typed Devart DataSets. Here is a simple example built using this article:
http://msdn.microsoft.com/en-us/library ... S.90).aspx

Code: Select all

      dataSet11.Fill();
      DataTable dt = dataSet11.Tables[0];
      var q = from d in dt.AsEnumerable()
              select new
              {
                Deptno = d.Field("Deptno"),
                Dname = d.Field("Dname")
              };
      q.ToList();


Posted: Mon 14 Jun 2010 16:19
by degas
Yes, you can that way, but whats the pint of having a TypedDataSet if i have to manually typed the column name. This is not control at compile time.

When i meant using LINQ to TypedDataSet i meant something like this.

string connectString =
"AttachDBFileName='C:\ProgramFiles\LINQ Preview\Data\Northwnd.mdf';" +
"Server='.\SQLEXPRESS';Integrated Security=SSPI;enlist=false";

using(Northwind db = new Northwind(connectString)) {
var customers = from c in db.Customers
where c.City == "London"
select c;

foreach(Customer c in customers) {
Console.WriteLine("{0}\t{1}", c.ContactName, c.CompanyName);


I got this from: http://msdn.microsoft.com/en-us/library ... S.80).aspx


I have also tested the generated TypedDataSet, from VS and i can use it with LINQ like the example above

Posted: Wed 16 Jun 2010 15:24
by AndreyR
Thank you for the report.
We are working on the implementation of this functionality.
Unfortunately, we don't have any definite timeframe for this to be implemented. I will post here about the progress.