Hello,
I am trying to update ab SQL database from a datagridview.
My question is that the grid may have 16 columns and 2 or more rows.
Can I just update the dataset
Dim griddataset As DataSet = New DataSet
Dim Savedatagridadapter As New SqlDataAdapter
Savedatagridadapter.Select
Command = New SqlCommand
Savedatagridadapter.Update
Command.Co
nnection = objconnection ' New SqlConnection("server = dev2003;database= tp;" & "user ID =
sa;password = someword;")
' Savedatagridadapter.Update
Command.Co
mmandText = ("invCreateInvdetpRecord")
' Savedatagridadapter.Update
Command.Co
mmandType = CommandType.StoredProcedur
e
Savedatagridadapter.Update
Command.Pa
rameters.A
dd("gridda
tset")
I have a stored procedure to update the records but will I have to assign a value to each column?
Savedatagridadapter.Parame
ters.Add(N
ew System.Data.SqlClient.SqlP
arameter("
@order", System.Data.SqlDbType.VarC
har, 11, "order"))
I just want to be able to update the database with the changes the user makes to the datagridview.
I have used vb for years but nre to vb.net so go easy on the old fellor.
Thanks for your help and thoughts.
Cheers
Mike
Start Free Trial