A
Abhishek
Hello,
I was using Datagrid (Windows Forms) the datasource of which was
a DataTable.
If I try to modify or delete some rows from the Datagrid using the
underlying DataTable then
I use Select method of the DataTable to get the corresponding row from the
DataTable.
I use the code as mentioned below:
string strSelect = "TerminalNumber = " + iTermNo;
DataRows[] oRows = oTable.Select(strSelect);
This works fine till the stage when the DataTable has rows less than 10.
However when the
DataTable has rows more than 10 then the select method does not return any
rows even if
the TerminalNumber(if it is 2 digit eg. 10,11,12 etc.) is present in the
Grid/Table.
Is this a bug in Datagrid/DataTable?
It works fine if the code is changed as follows:
string strSelect = "TerminalNumber = '" + iTermNo + "'";
DataRows[] oRows = oTable.Select(strSelect);
i.e. enclosing the iTermNo within single quotes.
Thanks for your help,
Abhishek.
I was using Datagrid (Windows Forms) the datasource of which was
a DataTable.
If I try to modify or delete some rows from the Datagrid using the
underlying DataTable then
I use Select method of the DataTable to get the corresponding row from the
DataTable.
I use the code as mentioned below:
string strSelect = "TerminalNumber = " + iTermNo;
DataRows[] oRows = oTable.Select(strSelect);
This works fine till the stage when the DataTable has rows less than 10.
However when the
DataTable has rows more than 10 then the select method does not return any
rows even if
the TerminalNumber(if it is 2 digit eg. 10,11,12 etc.) is present in the
Grid/Table.
Is this a bug in Datagrid/DataTable?
It works fine if the code is changed as follows:
string strSelect = "TerminalNumber = '" + iTermNo + "'";
DataRows[] oRows = oTable.Select(strSelect);
i.e. enclosing the iTermNo within single quotes.
Thanks for your help,
Abhishek.