C
Curious
I have a variable "dataTable" that is of type System.Data.DataTable.
It has three columns, CCy, Point, and Book.
I want to get all of the records with the restriction of their column
"CCy" being of value "ARS". Therefore, I have the following LINQ
statement:
var smallTable =
from d in dataTable
where d.Columns["CCy"] = "ARS"
select new
{
Point =
d.Columns["Point"],
Book =
d.Columns["Book"]
};
Even before I compile, several texts are highlighted in red color so I
know it won't compile. For instance, "where" is highlighted in red
with tooltip message "Cannot resolve symbol 'Where'".
Also, all of the "Columns" are highlighted in red with tooltip message
"Cannot resolve symbol 'Columns'"
What's wrong with the statement? How to fix it?
It has three columns, CCy, Point, and Book.
I want to get all of the records with the restriction of their column
"CCy" being of value "ARS". Therefore, I have the following LINQ
statement:
var smallTable =
from d in dataTable
where d.Columns["CCy"] = "ARS"
select new
{
Point =
d.Columns["Point"],
Book =
d.Columns["Book"]
};
Even before I compile, several texts are highlighted in red color so I
know it won't compile. For instance, "where" is highlighted in red
with tooltip message "Cannot resolve symbol 'Where'".
Also, all of the "Columns" are highlighted in red with tooltip message
"Cannot resolve symbol 'Columns'"
What's wrong with the statement? How to fix it?