DataTable.Select() Method problem..
Hi.
While executing the following code:
DataRow[] countryDataRows = destinationsDataSet.Tables[countryDataSetTableName].Select("country_desc = " + country);
im getting the following exception:
System.Data.EvaluateException : "Cannot find column [Armenia]." (while country = "Armenia")
but the column name im running the filter on named "country_desc", why does it thinks that the "country" string variable is the column name? is it something with the underline at the column name?
thanks...
Re: DataTable.Select() Method problem..
try this :
Code:
DataRow[] countryDataRows = destinationsDataSet.Tables[countryDataSetTableName].Select("country_desc like '" + country+"'");
Re: DataTable.Select() Method problem..
If you have the exact country name in the variable country then you could try.
Code:
DataRow[] countryDataRows = destinationsDataSet.Tables[countryDataSetTableName].Select("country_desc = '" + country + "'");
That will get you the data rows that match the country name exactly.
Warm Regards.
Quote:
Originally Posted by
xenomarz
Hi.
While executing the following code:
DataRow[] countryDataRows = destinationsDataSet.Tables[countryDataSetTableName].Select("country_desc = " + country);
im getting the following exception:
System.Data.EvaluateException : "Cannot find column [Armenia]." (while country = "Armenia")
but the column name im running the filter on named "country_desc", why does it thinks that the "country" string variable is the column name? is it something with the underline at the column name?
thanks...