Murray Brown
asked on
SQL Get number of records affected in SQL Update
Hi
I use several SQL update statements such the one below in my VB.net project.
How do I get the number of records affected by each update statement?
Dim sSQL As String
sSQL = "Update [" & Me.lblCurrentTable.Text & "] Set Category1 = '" & Me.cmbCategory1.Text & "'"
sSQL = sSQL & " Where [Product ID] = '" & oProductID & "'"
Dim cn As New SqlConnection(My.Settings. CS)
Dim cmd As New SqlCommand(sSQL, cn)
cn.Open()
cmd.ExecuteNonQuery()
cn.Close()
I use several SQL update statements such the one below in my VB.net project.
How do I get the number of records affected by each update statement?
Dim sSQL As String
sSQL = "Update [" & Me.lblCurrentTable.Text & "] Set Category1 = '" & Me.cmbCategory1.Text & "'"
sSQL = sSQL & " Where [Product ID] = '" & oProductID & "'"
Dim cn As New SqlConnection(My.Settings.
Dim cmd As New SqlCommand(sSQL, cn)
cn.Open()
cmd.ExecuteNonQuery()
cn.Close()
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER