I'm new to LINQ, I used LINQ to SQL to communicate with two tables, it returns data, which is great. I'm trying to understand what a data type is returning and how can I work with this data type?
I am used to working with datatables. Do we upload LINQ data? (And all other ADO.Net objects, for example, rows, data sets, etc.)? If so, what will we replace it with, and how can I use it to do everything I did before using datatables? In addition, it makes sense to replace the data, do they have a drawback?
Here is the code:
protected IEnumerable<string> GetMarketCodes()
{
LINQOmniDataContext db = new LINQOmniDataContext();
var mcodes = from p in db.lkpMarketCodes
orderby 0
select p;
return (IEnumerable<string>) mcodes;
}
This code is currently returning data (I see it in debugging), but there are errors in the "return" line, because apparently my data type is not IEnumerables, and that was my best guess. So, another thing that I would like to understand is that the data type is my data that is being entered and how to return it to the calling function.
source
share