SQLDataAdapter.Update not working

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

Is it possible to update a database via stored procedure without data
binding the dataset to the form?

I ran across this problem and can not seem to figure it out. The problem is
I have a stored procedure with two parameters, I set the values of the
parameters in code

Me.SqlDataAdapter.updatecommand.parameters("@myno").value =
cint(me.textbox1.text)
me.sqldataAdapter.updatecommand.parameters("@myName").value = me.textbox2.text

Then I call the update command

me.sqldataadapter.update(Dataset11,"SelectNames")

Everything seems to work okay, however when I refresh the dataset the
original values are still there and the update never actually stuck. I would
like to accomplish this without having to databind the dataset to the form,
but I'm missing something and I just can't get it to work. I can post
everything if need be, any help would be greatly appreciated.

Thank you
 
None of the rows have been marked as modified, therefore no rows are
updated.

Which row(s) should be updated with your new values? All of them?
 
Jim,

I'm only working with one row at a time. However I did find that if I set
the new values in the dataset

Me.dataset11.tables("SELECTNAMES").rows(0).item("Names") = Me.textbox2.text

rather than set the parameter values, the update worked fine.

Thanks for you help.
 
Back
Top