I created a saved update query for one of my table adapters. But so far, I have figured out how to use it when I want to update data into my database.
This is what I am using:
Code:
Private Sub subSaveData(ByVal sender As System.Object, _
ByVal e As System.EventArgs)
Me.Cursor = Cursors.WaitCursor
Me.EquipmentTableAdapter.Connection.ConnectionString = APC_WirelessConnectionString
Me.EquipmentTableAdapter.Update(Me.APC_WirelessDataSet.Equipment)
Me.APC_WirelessDataSet.Equipment.Clear()
Me.Cursor = Cursors.Default
End Sub
How do I tell it to use my saved query command?
I am using a Windows form with four combo boxes and a datagridview.
This is the update command I want to execute:
'"UPDATE Equipment " + _
'"SET " + _
'" LocationID = " & cmbLocation.SelectedValue & ", " + _
'" StatusID = " & cmbStatus.SelectedValue & ", " + _
'" OutColorID = " & cmbColor.SelectedValue & ", " + _
'" OutCarrierID = " & cmbCarrier.SelectedValue & ", " + _
'" user_update = '" & My.User.Name & "', " + _
'" date_update = getdate()" + _
'"WHERE ESN = '" & txtESN.Text & "';"
Thanks,
Karen