private void findlaksajob_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == (char)13) { string sql = "SELECT [Jobcard],[Planqty],[Mouldqty],[Operator],[Supervisor],[Profilename],[Process],[Date],[Remark],[Approvedby],[id],[Division],[Od] FROM [SAPProduction].[ProductionData] WHERE JobCard ='" + findlaksajob.Text.ToString() + "'"; SqlDataAdapter da = new SqlDataAdapter(sql, objConn1); DataSet ds = new DataSet(); objConn1.Open(); da.Fill(ds, "ProductionData"); dataGridView2.DataSource = ds; dataGridView2.DataMember = "ProductionData"; objConn1.Close(); e.Handled = true; } }