This is a sample search page that we use...
this needs to be in the web.config file
--------------------------------------
<appSettings>
<add key="ConnectionString" value="SERVER=VKSQL01;Max Pool Size=5000;Connection Lifetime=60;Application Name=ProjectMaintenance;Database=t2dvktest4;uid=sa;pwd=blackhook;" />
<add key="Timeout" value="30" />
</appSettings>
.vb file
-------------------
Public objConn As SqlConnection = New SqlConnection()
Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click
lbxClientSearch.Items.Clear()
Dim str As String
Dim search As String
Dim dsClient1 As DataSet = New DataSet()
search = Trim(txtClientSearch.Text)
search = Replace(search, "'", "''"
str = "Select clientID, case when firstname = '' or firstname is null then SearchName else searchname+', '+ firstname end as searchName from tblClient where searchname like '%" & search & "%'"
objConn.ConnectionString = ConfigurationSettings.AppSettings("ConnectionString"

Try
objConn.Open()
Dim sdaClient As SqlDataAdapter = New SqlDataAdapter(str, objConn)
sdaClient.Fill(dsClient1, "tblClient"

Dim dt As DataTable = dsClient1.Tables(0)
lbxClientSearch.DataSource = dt.DefaultView
lbxClientSearch.DataTextField = "searchName"
lbxClientSearch.DataValueField = "clientID"
lbxClientSearch.DataBind()
objConn.Close()
Catch objException As Exception
Response.Write("<h1>An error has occurred with the Database.</h1>"

Response.Write("<h3>Please Contact your Intranet administrator.</h3>"

Response.Write("<hr>"

Response.Write("<li><b>Message:</b> " & objException.Message)
Response.Write("<li><b>Source:</b> " & objException.Source)
Response.Write("<li><b>Stack Trace:</b> " & objException.StackTrace)
Response.End()
End Try
If lbxClientSearch.Items.Count = 1 Then
lbxClientSearch.SelectedIndex = 0
SetFocus(btnCharge)
ElseIf lbxClientSearch.Items.Count > 1 Then
SetFocus(lbxClientSearch)
Else
SetFocus(txtClientSearch)
End If
End Sub