Problem using dataadapter

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

    Problem using dataadapter

    Here's my problem,

    I try to populate a dataset using a dataadpater. I use ODBC.NET to
    access COBOL data with USQL odbc driver. My problem is that my table
    has no primary key. Here's my code :

    Dim myConnection As New OdbcConnection( "DSN=pg_dem;UID =dba;PWD=tom")
    Dim myAdapter As New OdbcDataAdapter
    Dim mySelectQuery As String = "SELECT no_gl, descript FROM gl_annu
    WHERE no_gl='12111000 0'"
    Dim DS As New DataSet
    myAdapter.Missi ngSchemaAction = MissingSchemaAc tion.Ignore
    myAdapter.Selec tCommand = New OdbcCommand(myS electQuery, myConnection)
    myAdapter.Fill( DS)

    I receive an error message in line : myAdapter.Fill( DS)

    I don't know exactly why but it seem that my table required a primary
    key if I want to use dataadapter and dataset. But if I use a
    datareader, this work great but I must insert, delete and update
    table. Do you know exactly why I have this problem and how I can mak
    this to work

    Thanks very much

Working...