If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Re: Update statement in vb.net 2008 using SQL 2008

Try this:

Code:

Using conn As New SqlConnection(My.Settings.Smitty)
Using cmd As New SqlCommand()
With cmd
.Connection = conn
.CommandText = "Update Repairs set status = @status WHERE RepairNumber = @repairNumber"
.Parameters.AddWithValue("@status", ComboBox1.Text)
.Parameters.AddWithValue("@repairNumber", CInt(Label1.Text))
End With
conn.Open()
cmd.ExecuteNonQuery()
End Using
End Using

Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.- Abraham Lincoln -