Error with adapter.update command ( formatexception ) ?

  • Thread starter Thread starter tommydnp
  • Start date Start date
T

tommydnp

When I use an adapter.update(dataset, "myTable"), I get the following
error:

System.FormatException: Index (zero based) must be greater than or
equal to zero and less than the size of the argument list.
at System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows,
DataTableMapping tableMapping)
at System.Data.Common.DbDataAdapter.Update(DataSet dataSet, String
srcTable)

There is one table with 2 columns and 3 rows in the dataset. Does
anyone know what the problem is?
 
Tommy,

Are you sure that your dataset contains a table (with the tablename
"myTable")?

Cor
 
Tommy,

Are you sure that your dataset contains a table (with the tablename
"myTable")?

Cor

tommydnp said:
When I use an adapter.update(dataset, "myTable"), I get the following
error:
System.FormatException: Index (zero based) must be greater than or
equal to zero and less than the size of the argument list.
at System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows,
DataTableMapping tableMapping)
at System.Data.Common.DbDataAdapter.Update(DataSet dataSet, String
srcTable)
There is one table with 2 columns and 3 rows in the dataset. Does
anyone know what the problem is?

I've found a solution. The problem was that I was working with OLEDB
data adapter which doesn't support the "@" parameters for building
commands.
 
I've found a solution. The problem was that I was working with OLEDB
data adapter which doesn't support the "@" parameters for building
commands

Yea a common problem, however for sure not to track with the information you
gave us. Tell us next time the way you construct and create your parameters.
For sure I (and others) could have told you the problem then direct.
System.FormatException: Index (zero based) must be greater than or
equal to zero and less than the size of the argument list.
at System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows,
DataTableMapping tableMapping)
at System.Data.Common.DbDataAdapter.Update(DataSet dataSet, String
srcTable)
There is one table with 2 columns and 3 rows in the dataset. Does
anyone know what the problem is?
..
 
Back
Top