sub Page_load(sender as object, E as eventargs)
dim objconnection As sqlconnection
dim objcommand as sqlCommand
dim objadapter as sqlDataAdapter
dim objdata As DataSet
dim strsearch as String
dim sqlquery as String
strsearch = tb1.text
if Len(trim(strSearch))>0 then
objConnection = new sqlconnection("Data Source=(localhost);")
sqlquery= "select * from mayank where (name"&strsearch.ToString()&")"
objcommand = new sqlcommand(sqlquery, objconnection)
objadapter = new sqlDataAdapter(objcommand)
objdata = new DataSet()
objadapter.Fill(objdata)
DataGrid1.DataSource = objdata
DataGrid1.DataBind()
objConnection.close
Else
tb1.text= "enter your search here"
end if
end sub
Checkwww.connectionstrings.com
Regards
No comments:
Post a Comment