Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- '====test number of bottles=============
- Dim bottlecount As Integer 'variable used in order to increase the value of no. of bottle/s used
- bottlecount = Form3.lblBottle.Text
- bottlecount += 1
- Form3.lblBottle.Text = bottlecount
- roomhold = 1
- Dim statement As String = "UPDATE tblPatientInfo SET bottle_used='" & bottlecount & "' WHERE room_number= '" & roomhold & "' ORDER BY ID ;"
- Dim cmd As New OleDbCommand
- With cmd
- .CommandText = statement
- .Connection = Conn
- Conn.Open()
- .ExecuteNonQuery()
- End With
- Conn.Close()
- End Sub
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- Dim bottlecount As Integer = CInt(Form3.lblBottle.Text) + 1
- Form3.lblBottle.Text = bottlecount
- roomhold = 1
- Dim statement As String = "UPDATE tblPatientInfo SET bottle_used = @bottlecount"
- statement &= "WHERE room_number = @roomhold"
- Dim cmd As New OleDbCommand
- With cmd
- .Connection = Conn
- .CommandType = CommandType.Text
- .CommandText = statement
- .Parameters.AddWithValue("@bottlecount", bottlecount)
- .Parameters.AddWithValue("@roomhold", roomhold)
- Conn.Open()
- .ExecuteNonQuery()
- End With
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- Dim bottlecount As Integer = cint(Form3.lblBottle.Text) + 1
- Form3.lblBottle.Text = bottlecount
- Dim roomhold AS Integer = 1
- Dim statement As String = "UPDATE tblPatientInfo SET bottle_used = @bottlecount "
- statement &= "WHERE room_number = @roomhold "
- Using conn as New SqlConnection("ConnectionStringHere")
- Using comm as New SqlCommand()
- With comm
- .Connection = conn
- .CommandType = CommandType.Text
- .CommandText = statement
- .Parameters.AddWithValue("@bottlecount", bottlecount )
- .Parameters.AddWithValue("@roomhold" , roomhold)
- End With
- Try
- conn.Open()
- comm.ExecuteNonQuery()
- Catch (ex as SQlException)
- ' add message here '
- Finally
- conn.Close()
- End Try
- End Using
- End Using
- End Sub
- Dim statement As String = "UPDATE tblPatientInfo SET bottle_used='" & bottlecount & "' WHERE room_number= '" & roomhold & "'"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement