944,135 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 1902
  • ASP.NET RSS
Apr 8th, 2007
0

Search record from SQLDatabase

Expand Post »
Private Sub btnsearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsearch.Click
Try
txtmsg.Text = ""
OleDbDataAdapter1 = New OleDbDataAdapter("select * from phbook where name like '" & ddl.SelectedItem.Text & "%'", OleDbConnection1)
OleDbDataAdapter1.Fill(DataSet21, "phbook")
OleDbConnection1.Open()
Dim com As New OleDbCommand
com.Connection = OleDbConnection1
com.CommandText = "select * from phbook"
dg1.DataBind()
Catch ex As Exception
txtmsg.Text = ex.ToString
OleDbConnection1.Close()
End Try
End Sub


i was tried this code to my application for search record form database.But got syntax error on ddl.selecteditem.text .

can anyone teach me how to make this code usefull to my application.
tq
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
june_bunga is offline Offline
3 posts
since Apr 2007
Apr 13th, 2007
0

Re: Search record from SQLDatabase

Use ddl.SelectedValue.ToString
Reputation Points: 12
Solved Threads: 11
Junior Poster in Training
ManicCW is offline Offline
95 posts
since Nov 2005
Apr 13th, 2007
0

Re: Search record from SQLDatabase

Click to Expand / Collapse  Quote originally posted by ManicCW ...
Use ddl.SelectedValue.ToString
still doesn't works. can u paste here what u have done.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
june_bunga is offline Offline
3 posts
since Apr 2007
Apr 13th, 2007
0

Re: Search record from SQLDatabase

Please paste your exception here.
Reputation Points: 12
Solved Threads: 11
Junior Poster in Training
ManicCW is offline Offline
95 posts
since Nov 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: Help with MySQL
Next Thread in ASP.NET Forum Timeline: Upload file





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC