Error thrown when adding row to database

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Greg

    #1

    Error thrown when adding row to database

    I have a datagrid bound to a database. I update the database using the
    following code:

    DataRow blankRow = _dataSet.Tables[_tickerTextTabl eName].NewRow();
    blankRow[_useElementColu mnName] = "True";

    _dataSet.Tables[_tickerTextTabl eName].Rows.InsertAt( blankRow, 2);

    _dataAdapter.Up date(_dataSet, _tickerTextTabl eName);


    I'm using a SQLcommand builder (class level) to look after the SQL to
    be sent to the DataSet.

    After updating, I'm getting a "System.Argumen tOutOfRangeExce ption".
    Presumably this is something to do with the datagrid. Should I be
    trapping a datagrid event?

    I'm a bit lost as to where this is going wrong!

    Any ideas?

    Thanks,

    Greg.

Working...