-
February 11th, 2009, 02:22 AM
#1
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...
-
February 11th, 2009, 03:18 AM
#2
Re: DataTable.Select() Method problem..
try this :
Code:
DataRow[] countryDataRows = destinationsDataSet.Tables[countryDataSetTableName].Select("country_desc like '" + country+"'");
-
February 27th, 2009, 03:27 AM
#3
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.
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...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|