Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

linq to DataTable issues

0 views
Skip to first unread message

Andy B

unread,
Apr 29, 2008, 4:13:54 PM4/29/08
to
Hi...

I have this DataTable: StockContract.Dictionary. I need a linq to DataTable
query that will select all rows where the "Word" column values match the
WordTextBox.Text value. I am running into some problems since the linq query
isn't totally like sql queries. If I wrote the query I am looking for in
sql, it would look like this:

select Word from StockContract.Dictionary where Word = WordTextBox.Text;
I then need to take the results of the query and determine if the value in
WordTextBox.Text is already in the column "Word" somewhere. Is there an
example of this somewhere?
I found this linq to DataTable on a google search, but it makes no sense to
me. Can somebody break it apart?

var query = from c in table.AsEnumerable() select new { Week =
c.Field<string>("Week"), Person = c.Field<string>("Person"), Guess =
c.Field<string>("Guess"), Actual = c.Field<string>("Actual") };


0 new messages