Hi Vb.net geniuses! I am a complete beginner in programming and would like to seek assistance regarding this very small issue of mine :( It is perfectly working if the CardID is only numbers, but if I mix letters with it this error is showing "Conversion from 'string' to 'boolean' type is not valid" Can someone explain to me why is this error showing? The Query that I created(ScalarQueryCardID) is just selecting the CardID from the database, which is datatype TEXT.
Private Sub Button5_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
If txtID.Text = "" Then
MessageBox.Show("Please Input Card ID")
Else
Dim cardid As String
cardid = txtID.Text
If Me.TbmembersTableAdapter.ScalarQueryCardID(cardid) Then
sql = "select * from tbmembers where CardID = '" & txtID.Text & "'"
da = New OleDb.OleDbDataAdapter(sql, con.ConnectionString)
da.Fill(ds, "tbmembers")
inc = 0
txtID.Text = ds.Tables("tbmembers").Rows(inc).Item("CardID")
txtname.Text = ds.Tables("tbmembers").Rows(inc).Item("FullName")
txtbalance.Text = ds.Tables("tbmembers").Rows(inc).Item("Balance")
btnadd.Enabled = True
txtID.Enabled = False
Else
MessageBox.Show("No Record Found")
txtID.Clear()
txtID.Enabled = True
End If
End If
End Sub