How to Run two Update Sql Queries using this Sql Snippet ?
The code mentioned below is updating values only in one table .... i want to update data in two different tables using the code mentioned below :
can anybody reedit this code ?
Try
Using conn = New SqlConnection(constr)
Using cmd = conn.CreateCommand()
conn.Open()
Dim sql As String =
"UPDATE a1_ticket
SET Ticket_no =@ticketNo,
BANK = @bank,
PAID = @paid,
BID = @bid
WHERE ITC = @ticketNo"
cmd.CommandText = sql
cmd.Parameters.AddWithValue("@bank", Literal20.Text)
cmd.Parameters.AddWithValue("@paid", Label1.Text)
cmd.Parameters.AddWithValue("@bid", Literal21.Text)
cmd.Parameters.AddWithValue("@ticketNo", Literal3.Text)
cmd.ExecuteNonQuery()
End Using
End Using
Catch ex As Exception
Response.Write(ex.Message)
End Try