B
Brad
I am having a data disappearance problem. On an edit routine, I have one
row of data being pulled into the dataset that is then displayed on a form.
The fields are bound to their respective controls. At the time that the SQL
query is run and that one data row is displayed, I am calling the
row(0).BeginEdit method. The user edits the data and then hits Save which
then I call the row(0).EndEdit method and also the dataAdapter.Update(ds).
For some reason some of the data that is displayed but not edited is not
being save back to the original datasource after the edit and these fields
now have null information. This is not good as some of the fields are text
memo fields and have to be re-typed.
What am I doing wrong here. Here is a snippet of code:
Editing the row:
DsEditReview1.Tables(0).Rows(0).BeginEdit()
Saving the changes:
DsEditReview1.Tables(0).Rows(0).Item("PlanR") =
CInt(CStr(cmbPlan.Text.Chars(0)))
DsEditReview1.Tables(0).Rows(0).Item("PlanT") = cmbPlan.Text.Remove(0, 3)
DsEditReview1.Tables(0).Rows(0).Item("PlanN") = txtPlan.Text
DsEditReview1.Tables(0).Rows(0).Item("ProbR") =
CInt(CStr(cmbProbSolv.Text.Chars(0)))
DsEditReview1.Tables(0).Rows(0).Item("ProbT") = cmbProbSolv.Text.Remove(0,
3)
DsEditReview1.Tables(0).Rows(0).Item("ProbN") = txtProbSolv.Text
DsEditReview1.Tables(0).Rows(0).Item("QualR") =
CInt(CStr(cmbQuality.Text.Chars(0)))
DsEditReview1.Tables(0).Rows(0).Item("QualT") = cmbQuality.Text.Remove(0, 3)
DsEditReview1.Tables(0).Rows(0).Item("QualN") = txtQual.Text
DsEditReview1.Tables(0).Rows(0).Item("AttendR") =
CInt(CStr(cmbAttend.Text.Chars(0)))
DsEditReview1.Tables(0).Rows(0).Item("AttendT") = cmbAttend.Text.Remove(0,
3)
DsEditReview1.Tables(0).Rows(0).Item("AttendN") = txtAttend.Text
DsEditReview1.Tables(0).Rows(0).EndEdit()
daEditReview.Update(DsEditReview1)
row of data being pulled into the dataset that is then displayed on a form.
The fields are bound to their respective controls. At the time that the SQL
query is run and that one data row is displayed, I am calling the
row(0).BeginEdit method. The user edits the data and then hits Save which
then I call the row(0).EndEdit method and also the dataAdapter.Update(ds).
For some reason some of the data that is displayed but not edited is not
being save back to the original datasource after the edit and these fields
now have null information. This is not good as some of the fields are text
memo fields and have to be re-typed.
What am I doing wrong here. Here is a snippet of code:
Editing the row:
DsEditReview1.Tables(0).Rows(0).BeginEdit()
Saving the changes:
DsEditReview1.Tables(0).Rows(0).Item("PlanR") =
CInt(CStr(cmbPlan.Text.Chars(0)))
DsEditReview1.Tables(0).Rows(0).Item("PlanT") = cmbPlan.Text.Remove(0, 3)
DsEditReview1.Tables(0).Rows(0).Item("PlanN") = txtPlan.Text
DsEditReview1.Tables(0).Rows(0).Item("ProbR") =
CInt(CStr(cmbProbSolv.Text.Chars(0)))
DsEditReview1.Tables(0).Rows(0).Item("ProbT") = cmbProbSolv.Text.Remove(0,
3)
DsEditReview1.Tables(0).Rows(0).Item("ProbN") = txtProbSolv.Text
DsEditReview1.Tables(0).Rows(0).Item("QualR") =
CInt(CStr(cmbQuality.Text.Chars(0)))
DsEditReview1.Tables(0).Rows(0).Item("QualT") = cmbQuality.Text.Remove(0, 3)
DsEditReview1.Tables(0).Rows(0).Item("QualN") = txtQual.Text
DsEditReview1.Tables(0).Rows(0).Item("AttendR") =
CInt(CStr(cmbAttend.Text.Chars(0)))
DsEditReview1.Tables(0).Rows(0).Item("AttendT") = cmbAttend.Text.Remove(0,
3)
DsEditReview1.Tables(0).Rows(0).Item("AttendN") = txtAttend.Text
DsEditReview1.Tables(0).Rows(0).EndEdit()
daEditReview.Update(DsEditReview1)