How to fill dataset using LINQ with FillDataSet(ds) Method. When iam trying to implement this code iam getting error like FillDataSet does not exist in current context.
My code is
DataSet ds = new DataSet();
ds.Locale = CultureInfo.InvariantCulture;
FillDataSet(ds);
DataTable products = ds.Tables["emp"];
IEnumerable<DataRow> query =
from product in dtContext.emps.AsEnumerable()
select product;
Please tell me how to fill dataset with FillDataSet(ds) Method.
Thank you.
You don’t have to fill a
DataSetwith LINQ2SQL. Nor do you have to useDataTableetc. All you need is the data context and perform queries on that:querywill be of typeIQueryable<T>and you can use e.g. aforeachon it to go through its content, or filter it further with awhereclause. Why do you want aDataSet?