glewis1636
Programmer
I have a dataadapter that joins two tables with and inner join. Because of this I can't use commandbuilder to build my update, insert, and delete commands. I've built the following update command, but get a dbconcurrency error when the da.update(dataset) is executed. Help.
I know the dataset has changes because I have a messagebox that fires if dataset.haschanges = true.
I know the dataset has changes because I have a messagebox that fires if dataset.haschanges = true.
Code:
cmdSalesRepUpdate = New SqlCommand("UPDATE SalesRep set ProspectID=@ProspectID, " & _
"SalesRepID=@SalesRepID, CallBackDate=@CallBackDate, ActionCode=@ActionCode FROM SalesRep INNER JOIN " & _
"SalesReps on SalesRep.SalesRepID = SalesReps.SalesRepID WHERE CallBackDate = @oldCallBackDate", SqlConnection1)
Dim parm As SqlParameter
cmdSalesRepUpdate.Parameters.Add("@ProspectID", SqlDbType.BigInt, 8, "ProspectID")
cmdSalesRepUpdate.Parameters.Add("@SalesRepID", SqlDbType.Char, 10, "SalesRepID")
cmdSalesRepUpdate.Parameters.Add("@CallBackDate", SqlDbType.DateTime, 8, "CallBackDate")
cmdSalesRepUpdate.Parameters.Add("@ActionCode", SqlDbType.Char, 2, "ActionCode")
parm = cmdSalesRepUpdate.Parameters.Add("@oldCallBackDate", SqlDbType.DateTime, 8, "CallbackDate")
parm.SourceVersion = DataRowVersion.Original
daSalesRep.UpdateCommand = cmdSalesRepUpdate