Private Sub TextBox1_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtSearch.KeyDown
If (e.KeyCode = Keys.Enter) Then
Dim strID = Me.txtSearch.Text
Dim objConn As New System.Data.SqlClient.SqlConnection
Dim objCmd As New System.Data.SqlClient.SqlCommand
Dim dtAdapter As New System.Data.SqlClient.SqlDataAdapter
strID = strID.Trim.PadLeft(10, "0")
txtSearch.Text = strID
Dim dt As DataTable
Dim strConnString, strSQL As String
strConnString = "Server=localhost;UID=sa;PASSWORD=xxx;database=xxx;Max Pool Size=400;Connect Timeout=600;"
strSQL = "SELECT * FROM tb_employee WHERE emp_id = '" & strID & "' "
Dim dtFind As New DataTable
Dim connection As New SqlConnection(strConnString)
Dim dataadapter As New SqlDataAdapter(strSQL, connection)
Dim ds As New DataSet
connection.Open()
dataadapter.Fill(ds, "Authors_table")
connection.Close()
DataGrid1.DataSource = ds
DataGrid1.DataMember = "Authors_table"
End If
End Sub