I need to update the changes in a datagridview. My query has multiple joins, so the commandbuilder does not work. I never created an update command using update statements with parameters before and would appreciate any help. Do I have to get the changes and put them in a new dataset first? The fields that need to be updated are CheckedOutTo, DueDate, Comments, and Analyst. Please see query string below. Thanks!
Dim sql As String = <s> SELECT a.Loaner, a.Code, a.Model, b.CheckedOutTo, b.DueDate, b.Comments, b.Analyst
FROM tblLoaners AS a
LEFT JOIN (SELECT tblTransactions.CheckedOutTo, tblTransactions.DueDate,
tblTransactions.Comments, tblTransactions.Analyst, tblTransactions.Loaner
FROM ((tblTransactions INNER JOIN tblBorrowers ON tblTransactions.CheckedOutTo = tblBorrowers.ID)
INNER JOIN tblAnalysts ON tblTransactions.Analyst = tblAnalysts.AnalystID)
WHERE tblTransactions.CheckedInDate IS NULL) AS b ON a.ID = b.Loaner
WHERE a.Active = 'Active' </s>
Dim sql As String = <s> SELECT a.Loaner, a.Code, a.Model, b.CheckedOutTo, b.DueDate, b.Comments, b.Analyst
FROM tblLoaners AS a
LEFT JOIN (SELECT tblTransactions.CheckedOutTo, tblTransactions.DueDate,
tblTransactions.Comments, tblTransactions.Analyst, tblTransactions.Loaner
FROM ((tblTransactions INNER JOIN tblBorrowers ON tblTransactions.CheckedOutTo = tblBorrowers.ID)
INNER JOIN tblAnalysts ON tblTransactions.Analyst = tblAnalysts.AnalystID)
WHERE tblTransactions.CheckedInDate IS NULL) AS b ON a.ID = b.Loaner
WHERE a.Active = 'Active' </s>