🔒 Closed Update error

Status
Not open for further replies.

Netflix

Forum Veteran
Please help pull me out , I'm making an update on an event(button). In this form which is giving me an error "NO value given for one or more required parameters" My TextBox1 is set to TextBox1.Enable=False

Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

       Dim sample As String
       sample = Label11.Text
       cn = New OleDbConnection(con)
       cn.Open()
       With cmd
           .Connection = cn
           .CommandText = "UPDATE [Borrower] SET [Borrower_Name]='" & TextBox2.Text & _
               "',[Type]='" & ComboBox1.Text & _
               "',[Course]='" & ComboBox2.Text & _
               "',[Year]='" & ComboBox3.Text & _
               "',[Address]='" & TextBox5.Text & _
               "',[Contact_No]='" & TextBox6.Text & _
               "',[Penalty]='" & sample & "' WHERE Val(Borrower_ID)=" & Integer.Parse(TextBox1.Text) & ""
           .ExecuteNonQuery()

       End With
       MsgBox("Borrower Successfully Updated")
       cn.Close()
       cmd.Dispose()

       End Sub
 
Good day sir , try to find some web developing forums , more people will help you there :)
 
Mukhang Kulang ka din ng dalawang single quotes like this ''

Before(in this line):
WHERE Val(Borrower_ID)=" & Integer.Parse(TextBox1.Text) & "

After correction:

WHERE Val(Borrower_ID)='" & Integer.Parse(TextBox1.Text) & "'
 
Mukhang Kulang ka din ng dalawang single quotes like this ''

Before(in this line):
WHERE Val(Borrower_ID)=" & Integer.Parse(TextBox1.Text) & "

After correction:

WHERE Val(Borrower_ID)='" & Integer.Parse(TextBox1.Text) & "'
pag numbers okay lang kahit walang single quote... un ang pagkakaalam ko hehehehe
 
Mukhang Kulang ka din ng dalawang single quotes like this ''

Before(in this line):
WHERE Val(Borrower_ID)=" & Integer.Parse(TextBox1.Text) & "

After correction:

WHERE Val(Borrower_ID)='" & Integer.Parse(TextBox1.Text) & "'
parang tama ka bro
 
Status
Not open for further replies.

About this Thread

  • 10
    Replies
  • 564
    Views
  • 8
    Participants
Last reply from:
RunzZ

Online now

Members online
961
Guests online
733
Total visitors
1,694

Forum statistics

Threads
2,275,574
Posts
28,964,202
Members
1,231,870
Latest member
Dabojax
Back
Top