LINQ to typedDataSet

LINQ to typedDataSet

Postby degas » Tue 08 Jun 2010 16:40

The generated DataSet by DevArt cannot be used with LINQ? Or is there a way to generated a LINQ-enabled TypedDataSet
degas
 
Posts: 77
Joined: Mon 16 Feb 2009 18:36
Location: Argentina

Postby AndreyR » Thu 10 Jun 2010 13:24

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 ... 40(v=VS.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();

AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Postby degas » Mon 14 Jun 2010 16:19

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/aa697427(VS.80).aspx


I have also tested the generated TypedDataSet, from VS and i can use it with LINQ like the example above
degas
 
Posts: 77
Joined: Mon 16 Feb 2009 18:36
Location: Argentina

Postby AndreyR » Wed 16 Jun 2010 15:24

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.
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16


Return to dotConnect for Oracle