little problem replacing commandbuilder

G

Guest

I´m filling a typed Dataset in order to update a SqlServer DB

I created the DataAdapter and I used the CommandBuilder to generate the
INSERT Statement, Good!!

Now I don't want to use the CommandBuilder anymore (performance) but when I
setup the dataAdapter.InsertCommand property (with both the Insert query
generated by the wizard either generated by Commandbuilder)

INSERT INTO Ventas( ID , NroTicket , FechaHora , IDLoteria , NumeroJugado ,
MontoJugado ) VALUES ( @p1 , @p2 , @p3 , @p4 , @p5 , @p6 )


I receive an error like this : The variable @p1 has not been defined.

What am I doing wrong?

Ken
 
S

Scott M.

You are indicating in your INSERT statement that you wish to use ADO.NET
Parameters (that's what the @ means). It sounds like you haven't created
any and added them to your command object yet.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top