Page 1 of 1
how to convert Devart.Data.Linq.Table to System.Data.DataTable
Posted: Wed 17 Dec 2014 07:36
by Marsh
I wonder how to convert Devart.Data.Linq.Table to System.Data.DataTable.
I have Devart.Data.Linq.DataContext which I got from LinqConnect Migration Wizard.
MyDataContext.MyTables returns Devart.Data.Linq.Table<Table> and I want to convert this to DataTable. Could you help me?
Re: how to convert Devart.Data.Linq.Table to System.Data.DataTable
Posted: Thu 18 Dec 2014 10:28
by MariiaI
Unfortunately, it can't be done with LinqConnect.
Please describe the scenario you are implementing and tell us, why you want to convert Devart.Data.Linq.Table to System.Data.DataTable.
In fact, you can run SQL command via plain ADO.NET to get a System.Data.DataTable as a result.
Re: how to convert Devart.Data.Linq.Table to System.Data.DataTable
Posted: Fri 19 Dec 2014 00:51
by Marsh
Because I need DataTable to pass to other methods and I want to unify database usage to DataContext. I don't want to make separate codes for database connection.
I saw articles about converting IQueryable to DataTable. Isn't there any workaround to convert Devart.Data.Linq.Table to System.Data.DataTable?
Re: how to convert Devart.Data.Linq.Table to System.Data.DataTable
Posted: Fri 19 Dec 2014 10:20
by MariiaI
In fact, this is not a LinqConnect specific question. However, you are right, there are some articles about converting IQueryable to DataTable, for example, this one:
http://forums.asp.net/t/1806946.aspx?Co ... +Datatable
We have prepared a test project based on this article and sent you to the e-mail address you have provided in your forum profile. Please check that the letter is not blocked by your mail filter.
Please tell us if this helps.