B
Bob
Hi,
I have a typed unbound dataset that is passed to a datahandling class to be
filled.
The datahandling class fills it from a sproc using an oledbDataAdapter
(SQLAnywhere database)
The only table in the dataset has two int32 columns.
There is one row of data and as expected, column 0 contains an int and
column 1 contains a null.
I want to update column1.
The following code executes but the row cell remains unchanged.
I cannot see how an assignment statement can execute without error and the
target remain unchanged.
This in itself seems a bug.
I thought it may have been related to there being a null in the field but
the same thing happens when I try to change the value of the column0.
Can anyone see what is wrong?
thanks
Bob
private void button1_Click(object sender, EventArgs e)
{
dsBatchAssignable ds =new dsBatchAssignable();// Typed dataset with two int
fields
if (mDt.GetAssignableBatches(ds))
{
if ((int)ds.Tables[0].Rows[0].ItemArray[0] ==805) //Proving that table has
been filled.
ds.Tables[0].Rows[0].ItemArray[1] = "3"; //inspection shows System.DBNull
value (expected) before AND AFTER assignment.
if (ds.HasChanges())
MessageBox.Show("Altered"); //Dont get here
}
}
I have a typed unbound dataset that is passed to a datahandling class to be
filled.
The datahandling class fills it from a sproc using an oledbDataAdapter
(SQLAnywhere database)
The only table in the dataset has two int32 columns.
There is one row of data and as expected, column 0 contains an int and
column 1 contains a null.
I want to update column1.
The following code executes but the row cell remains unchanged.
I cannot see how an assignment statement can execute without error and the
target remain unchanged.
This in itself seems a bug.
I thought it may have been related to there being a null in the field but
the same thing happens when I try to change the value of the column0.
Can anyone see what is wrong?
thanks
Bob
private void button1_Click(object sender, EventArgs e)
{
dsBatchAssignable ds =new dsBatchAssignable();// Typed dataset with two int
fields
if (mDt.GetAssignableBatches(ds))
{
if ((int)ds.Tables[0].Rows[0].ItemArray[0] ==805) //Proving that table has
been filled.
ds.Tables[0].Rows[0].ItemArray[1] = "3"; //inspection shows System.DBNull
value (expected) before AND AFTER assignment.
if (ds.HasChanges())
MessageBox.Show("Altered"); //Dont get here
}
}