hi all,
A bit of problem which i am not able to resolv.please help.I am using
dataAdapter.Update(ds, "tablename") to update table.object reference set to instance of object is error .following is sample code sending.
'on form load
Dim dataAdapter As New SqlDataAdapter(cmdString, conn)
Dim ds As New DataSet
dataAdapter.Fill(ds, "testmaster")
dataTable = ds.Tables("Testmaster")
'for initializing commads for updat command initialization
Dim updateCommand As New SqlCommand("UpdateProc", conn)
updateCommand.CommandType = CommandType.StoredProcedure
dataAdapter.UpdateCommand = updateCommand
AddParams(dataAdapter.UpdateCommand, "testdesc", "yearoftest")
'on update button following is the code
Dim row As DataRow = dataTable.Rows(currRec)
row.BeginEdit()
row("testdesc") = txtArticleTitle.Text
row("yearoftest") = txtArticleTopic.Text
row.EndEdit()
dataAdapter.Update(ds, "article")
Thanks in advance
A bit of problem which i am not able to resolv.please help.I am using
dataAdapter.Update(ds, "tablename") to update table.object reference set to instance of object is error .following is sample code sending.
'on form load
Dim dataAdapter As New SqlDataAdapter(cmdString, conn)
Dim ds As New DataSet
dataAdapter.Fill(ds, "testmaster")
dataTable = ds.Tables("Testmaster")
'for initializing commads for updat command initialization
Dim updateCommand As New SqlCommand("UpdateProc", conn)
updateCommand.CommandType = CommandType.StoredProcedure
dataAdapter.UpdateCommand = updateCommand
AddParams(dataAdapter.UpdateCommand, "testdesc", "yearoftest")
'on update button following is the code
Dim row As DataRow = dataTable.Rows(currRec)
row.BeginEdit()
row("testdesc") = txtArticleTitle.Text
row("yearoftest") = txtArticleTopic.Text
row.EndEdit()
dataAdapter.Update(ds, "article")
Thanks in advance