How to return a Dataset/DataTable or DataView from a LINQ query result
-
I have the following codes. But, I want to change the return type so it can return either Dataset/DataTable or DataView. How I can do that? linqAdventureWorksDataContext is a class created by "LINQ to SQL class" using the O/R designer in VS2008. public IQueryable<TransactionHistory> getTransactionHist(Int32 productID) { linqAdventureWorksDataContext linqAW = new linqAdventureWorksDataContext(); var ProductTran = from m in linqAW.TransactionHistories where m.ProductID == productID select m; return ProductTran; }
-
I have the following codes. But, I want to change the return type so it can return either Dataset/DataTable or DataView. How I can do that? linqAdventureWorksDataContext is a class created by "LINQ to SQL class" using the O/R designer in VS2008. public IQueryable<TransactionHistory> getTransactionHist(Int32 productID) { linqAdventureWorksDataContext linqAW = new linqAdventureWorksDataContext(); var ProductTran = from m in linqAW.TransactionHistories where m.ProductID == productID select m; return ProductTran; }
Deja View - the feeling that you've seen this post before.
-
Deja View - the feeling that you've seen this post before.
Just Like u can Use it OpenConnection sql=Select * from Dbo.MYtable cmd = new odbc.command(sql,conn) reader = cmd.executereader while reader.read //Execute command Text here end while It returns you Data View. Anubhava Dimri anubhava.prodata@gmail.com 9250168195:rose:
-
Just Like u can Use it OpenConnection sql=Select * from Dbo.MYtable cmd = new odbc.command(sql,conn) reader = cmd.executereader while reader.read //Execute command Text here end while It returns you Data View. Anubhava Dimri anubhava.prodata@gmail.com 9250168195:rose:
The OP asked how to do this in LINQ. How is this LINQ?
Deja View - the feeling that you've seen this post before.
-
The OP asked how to do this in LINQ. How is this LINQ?
Deja View - the feeling that you've seen this post before.
Don't worry about it. Some things are lost in translation... :rolleyes:
-- Kein Mitleid Für Die Mehrheit
-
The OP asked how to do this in LINQ. How is this LINQ?
Deja View - the feeling that you've seen this post before.
He can alter it a bit to make it linq ;-)
var sql = from s in new string[]{"Select * from Dbo.MYtable"}
select s;cmd = new odbc.command(sql,conn)
reader = cmd.executereader
while reader.readThat qualifies, dont it? , right, right? ;-)
Blog: http://www.rogeralsing.com Projects: http://www.puzzleframework.com
-
I have the following codes. But, I want to change the return type so it can return either Dataset/DataTable or DataView. How I can do that? linqAdventureWorksDataContext is a class created by "LINQ to SQL class" using the O/R designer in VS2008. public IQueryable<TransactionHistory> getTransactionHist(Int32 productID) { linqAdventureWorksDataContext linqAW = new linqAdventureWorksDataContext(); var ProductTran = from m in linqAW.TransactionHistories where m.ProductID == productID select m; return ProductTran; }
Watch it guys Knowledge Experts :cool: are Here with Solution
Follow the Link
http://www.blog.vimallakhera.com/BlogId_2073_BlogItem.aspx
(Knowledge Experts) Vimal Lakhera, Senior Software Engineer Corbus (India) Pvt. Ltd. | A CMMi Level 5 Company Cell) (+91) 9818 511 428 E-Mail: info@vimallakhera.com | http://www.vimallakhera.com