G
Guest
Hi All,
I am working on a windows application. I am facing a problem in accessing
the added row of a table using Table.Select method.
Following explains the problem
Following is my table
Table: BatchData
PrimaryKey : BatchId INT IDENTITY (AutoIndex Column)
I am accesing the table's data in a dataset with FillSchema and Fill ,and I
made the primarykey.readonly = false
DS.Tables("BatchData").PrimaryKeyColumn.Readonly = false
I am binding the part of the table to a DataGrid (Based on Selectction
criterion). I am adding the rows to the grid, which inturn adding rows to my
data table. I am able to access the added rows. Now I want to change the
primaryKey value of the added rows.I am able to assign the value to the
primary Key. When I am trying to access the row with the newly assigned
value, I am not able to retrieve the row.
Following are the initial values
DataRow dr = DS.Tables("BatchData").GetChanges(RowState.Added)(0)
dr("PrimaryKey") is 850 now -- Initial Value
I want to assign value - 10001 to the primary key
DS.Tables("BatchData").Select("BatchId = 850")(0)("BatchId") = 10001 -- New
Value
I am able to assign the value, Now I am trying to retrieve the row like the
following
DS.Tables("BatchData").Select("BatchId = 10001")
Here I am facing the problem, I am not able to retrieve the row data if I
use the newly assigned value..
Please help me in solving this problem..
Regards,
RaviKiran
I am working on a windows application. I am facing a problem in accessing
the added row of a table using Table.Select method.
Following explains the problem
Following is my table
Table: BatchData
PrimaryKey : BatchId INT IDENTITY (AutoIndex Column)
I am accesing the table's data in a dataset with FillSchema and Fill ,and I
made the primarykey.readonly = false
DS.Tables("BatchData").PrimaryKeyColumn.Readonly = false
I am binding the part of the table to a DataGrid (Based on Selectction
criterion). I am adding the rows to the grid, which inturn adding rows to my
data table. I am able to access the added rows. Now I want to change the
primaryKey value of the added rows.I am able to assign the value to the
primary Key. When I am trying to access the row with the newly assigned
value, I am not able to retrieve the row.
Following are the initial values
DataRow dr = DS.Tables("BatchData").GetChanges(RowState.Added)(0)
dr("PrimaryKey") is 850 now -- Initial Value
I want to assign value - 10001 to the primary key
DS.Tables("BatchData").Select("BatchId = 850")(0)("BatchId") = 10001 -- New
Value
I am able to assign the value, Now I am trying to retrieve the row like the
following
DS.Tables("BatchData").Select("BatchId = 10001")
Here I am facing the problem, I am not able to retrieve the row data if I
use the newly assigned value..
Please help me in solving this problem..
Regards,
RaviKiran