E
eagle
This is my code, and nothing appears to happen. The dataset has 3 rows, I
do an insert, and the dataset still has 3 rows. What am I missing or doing
wrong? There is nothing wrong with the query, or the connection, and I get
no errors, it just doesn't return the dataset with the inserted row. I
thank you so much for your help.
Public Function UpdateDataset as Dataset
Dim ds as dataset = GetDataSet("tblClients")
Dim cn as SqlConnection = New SqlConnection(mstrSQLConn)
Dim qry as String = "Insert into tblClients (firstname, lastname)
values ('Jane', 'Smith')
Dim cmd As New SqlCommand(qry, cn)
cn.open
Dim dataAdapter As New SqlDataAdapter
dataAdapter.InsertCommand = cmd
dataAdapter.Update(ds, "tblClients")
ds.AcceptChanges()
Return ds
End Function
do an insert, and the dataset still has 3 rows. What am I missing or doing
wrong? There is nothing wrong with the query, or the connection, and I get
no errors, it just doesn't return the dataset with the inserted row. I
thank you so much for your help.
Public Function UpdateDataset as Dataset
Dim ds as dataset = GetDataSet("tblClients")
Dim cn as SqlConnection = New SqlConnection(mstrSQLConn)
Dim qry as String = "Insert into tblClients (firstname, lastname)
values ('Jane', 'Smith')
Dim cmd As New SqlCommand(qry, cn)
cn.open
Dim dataAdapter As New SqlDataAdapter
dataAdapter.InsertCommand = cmd
dataAdapter.Update(ds, "tblClients")
ds.AcceptChanges()
Return ds
End Function