OleDbCommand Parameters - values don't transfer

  • Thread starter Thread starter TF
  • Start date Start date
T

TF

Hi,

Scenario:

I have few TextBoxes on a WinForm, bound to a DataSet (using
DataBindings collection). Initially only schema is filled in DataSet
(using FillSchema() method), then a new row is added using
DataTable.NewRow(). I set the values of few columns of the table at
the time when new row is added. Rest of the columns are updated
through TextBoxes. The values in the table updates successfuly when i
update any TextBox text.

Problem:

When I call OleDbDataAdaper.Update() method to insert new row in data
source (MS Access), only values that i set at the time when new row is
added are transfered in the OleDbParameters (defined in
OleDbDataAdaper.InsertCommand.Parameters collection) and none of the
values updated through TextBoxes transfer to parmeter. I verified this
in OleDbDataAdaper.RowUpdating event, where all parameters
corresponding to columns update through TextBoxes are null, while
others has correct values. Although row going to be updated in same
event has all the current values. Somehow they are not transfered to
Parameters and generating error while update.

Pease help!!! I spent a lot of time but in vain.
 
Back
Top