Error with adapter.update command ( formatexception ) ?

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

    #1

    Error with adapter.update command ( formatexception ) ?

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

    System.FormatEx ception: Index (zero based) must be greater than or
    equal to zero and less than the size of the argument list.
    at System.Data.Com mon.DbDataAdapt er.Update(DataR ow[] dataRows,
    DataTableMappin g tableMapping)
    at System.Data.Com mon.DbDataAdapt er.Update(DataS et dataSet, String
    srcTable)

    There is one table with 2 columns and 3 rows in the dataset. Does
    anyone know what the problem is?
  • Cor Ligthert [MVP]

    #2
    Re: Error with adapter.update command ( formatexception ) ?

    Tommy,

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

    Cor

    "tommydnp" <tommydnp@gmail .comschreef in bericht
    news:35721677-d49a-4489-8db4-92125db3aab9@e6 g2000prf.google groups.com...
    When I use an adapter.update( dataset, "myTable"), I get the following
    error:
    >
    System.FormatEx ception: Index (zero based) must be greater than or
    equal to zero and less than the size of the argument list.
    at System.Data.Com mon.DbDataAdapt er.Update(DataR ow[] dataRows,
    DataTableMappin g tableMapping)
    at System.Data.Com mon.DbDataAdapt er.Update(DataS et dataSet, String
    srcTable)
    >
    There is one table with 2 columns and 3 rows in the dataset. Does
    anyone know what the problem is?

    Comment

    • tommydnp

      #3
      Re: Error with adapter.update command ( formatexception ) ?

      On 14 dec, 13:23, "Cor Ligthert [MVP]" <notmyfirstn... @planet.nl>
      wrote:
      Tommy,
      >
      Are you sure that your dataset contains a table (with the tablename
      "myTable")?
      >
      Cor
      >
      "tommydnp" <tommy...@gmail .comschreef in berichtnews:357 21677-d49a-4489-8db4-92125db3aab9@e6 g2000prf.google groups.com...
      >
      When I use an adapter.update( dataset, "myTable"), I get the following
      error:
      >
      System.FormatEx ception: Index (zero based) must be greater than or
      equal to zero and less than the size of the argument list.
      at System.Data.Com mon.DbDataAdapt er.Update(DataR ow[] dataRows,
      DataTableMappin g tableMapping)
      at System.Data.Com mon.DbDataAdapt er.Update(DataS et 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.

      Comment

      • Cor Ligthert[MVP]

        #4
        Re: Error with adapter.update command ( formatexception ) ?

        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.FormatEx ception: Index (zero based) must be greater than or
        equal to zero and less than the size of the argument list.
        at System.Data.Com mon.DbDataAdapt er.Update(DataR ow[] dataRows,
        DataTableMappin g tableMapping)
        at System.Data.Com mon.DbDataAdapt er.Update(DataS et dataSet, String
        srcTable)
        >>
        There is one table with 2 columns and 3 rows in the dataset. Does
        anyone know what the problem is?
        >
        ..

        Comment

        Working...