Adapter.Update on Two Tables

  • Thread starter Thread starter Mo
  • Start date Start date
M

Mo

Hello

I have a data set that contains two tables tblheader and tbldetails.
The insert command is a stored procedure with paramters. I am doing the following

adapter.InsertCommand.Parameters.Add(New SqlParameter("@p1", SqlDbType.VarChar, 40, strp1))
adapter.InsertCommand.Parameters.Add(New SqlParameter("@p2", SqlDbType.VarChar, 40, strp2))
adapter.InsertCommand.Parameters.Add(New SqlParameter("@p3", SqlDbType.VarChar, 40, strp3))

Now...strp1 and strp2 are the sourceColumn names of the columns that the paramters will be mapped to.
strp3 is a column in the header table...
when I do adapter.update (ds, tbldetail.tablename) it gives me an error that the sttored procedure expects paramter @p3 that was not supplied..
how can i solve this??
how can i join in ADO.NET??
thanks in advance




___
Newsgroups brought to you courtesy of www.dotnetjohn.com
 
Hi Mo,

I think by giving the needed right commands to the adapter before he start
the update

Cor
 
The right (Insert Command) is given to the data adapter...I only need to update inserts in my case. The problem is that I have a header table and a detail table. How can I JOIN the two tables in ADO.NET?
Hi Mo,

I think by giving the needed right commands to the adapter before he start
the update

Cor

___
Newsgroups brought to you courtesy of www.dotnetjohn.com
 
Back
Top