![]() |
| ||
| Search record from SQLDatabase 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 |
| ||
| Re: Search record from SQLDatabase Use ddl.SelectedValue.ToString |
| ||
| Re: Search record from SQLDatabase Quote:
|
| ||
| Re: Search record from SQLDatabase Please paste your exception here. |
| All times are GMT -4. The time now is 1:02 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC