Hi!

i just learned howto create a simple webpage displaying some database records on it. i know how to bind the database to a grid control and display data. But how can i search for some value in the database? i know SqlDataSource.Insert() method inserts data into the database. What methods i need to use to perform a database search?

Thanks for any help

strSearch = txtSearch.Text
		
objConnection = New SqlConnection("Data Source=10.2.1.214;"Initial Catalog=samples;User Id=samples;Password=password;Connect Timeout=15;Network Library=dbmssocn;")
strSQLQuery = "SELECT first_name, last_name, Sales FROM sample "
objCommand = New SqlCommand(strSQLQuery, objConnection)
objAdapter = New SqlDataAdapter(objCommand)
objDataSet = New DataSet()
objAdapter.Fill(objDataSet)
dgPaging.DataSource = objDataSet
dgPaging.DataBind()
objConnection.Close()
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.