Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jan 20, 2009 02:32 PM by firstname.lastname@example.org
Jan 20, 2009 12:04 PM|LINK
I think it's not possible or it may be a bug in LINQ
because last two days i'm trying to write a dynamic query to dataset but there is no solution in net and no help document realted to Dynamic Linq to DataSet.
Experts have any idea?
Jan 20, 2009 02:32 PM|LINK
My task is i have a dataset with N number of records, now i want to retrieve some records from there by user input but in my case i dont know the column name and datatypes of the column because based on situation different no. of column will
be added in dataset, so i tried with dynamic linq query by this article
http://aspalliance.com/1569_Dynamic_LINQ_Part_1_Using_the_LINQ_Dynamic_Query_Library.all they wrote for SQL
Dim Northwind as new NorthwindDataContext
Dim query = From P in Northwind.Products where ("CategoryId==2 And unitprice>3").OrderBy("SupplierId")
I convert the same syntax to DataSet
dataGridView1.DataSource = query;
but it raise an error as No property or field 'name' exists in type 'DataRow' (at index 0)
actually error thrown in yellow colored line, but the column "name" is exist in the DataSet. I tried with different column names but no luck!
What is the problem and how to solve this error experts please explain, i think it's problem in LINQ?