A
Assimalyst
Hi,
I'm attempting an update SQl Server using a gatagrid using ADO.
I am having trouble getting a changed value to work however.
The datagrid is populated as below:
sampleNo brush biopsy lavage histology patinetNo
Edit 87 True True True Squamous 67
The only editable column is histology.
I am using the following code to try to update any changes to that
cell:
DataRow sRow = dsSample.Tables["Table"].Rows[0];
sRow["Histology"] = ((TextBox)e.Item.Cells[5].Controls[0];
But no update occurs. If i change it to:
DataRow sRow = dsSample.Tables["Table"].Rows[0];
sRow["Histology"] = "New Text";
Then it does update. So it seems my cell referencing is wrong. Can
anyone tell me why? I have tried changing the [5] and [0], but get
errors.
Thanks.
I'm attempting an update SQl Server using a gatagrid using ADO.
I am having trouble getting a changed value to work however.
The datagrid is populated as below:
sampleNo brush biopsy lavage histology patinetNo
Edit 87 True True True Squamous 67
The only editable column is histology.
I am using the following code to try to update any changes to that
cell:
DataRow sRow = dsSample.Tables["Table"].Rows[0];
sRow["Histology"] = ((TextBox)e.Item.Cells[5].Controls[0];
But no update occurs. If i change it to:
DataRow sRow = dsSample.Tables["Table"].Rows[0];
sRow["Histology"] = "New Text";
Then it does update. So it seems my cell referencing is wrong. Can
anyone tell me why? I have tried changing the [5] and [0], but get
errors.
Thanks.