my program : When i enter a name in the textfiled and click on search i should get that name along with its ID listed below in my data grid and if such name does not exists i should get msg "enquiry not found"...
Am getting the result however not excatly....after 1st entry even if the name exists in database i get msg "enquiry not found" and the enquiry along with id gets listed in the datagrid.
PLZ CORRECT MY CODE FOR THE SAME
Secondly for each entry of name i want data grid to be refreshed....how to do it ??? plz let me know soon........ am wating......plzzzzzzzz
cua
Rohan
Private Sub checkenq()
dbadapter = New OleDbDataAdapter("select eid 'Enquiry ID' ,vname 'Name' ,vMobno 'Mobile No' from tblenquiry where vname = '" & (txtname.Text) & "'", connectionstring)
dbadapter.Fill(dtenquiry)
If txtname.Text = dtenquiry.Rows(0).Item(1) Then
MsgBox("Enquiry Exists")
dgenqrec.DataSource = dtenquiry
cmdfound.Enabled = True
Else
MsgBox("Enquiry Not Found, Kindly Fill the Enquiry Form")
End If