private void txtCode_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { THOK.XC.Process.Dal.ProductStateDal dal = new Process.Dal.ProductStateDal(); DataTable dt = dal.GetProductInfoByBarCode(this.txtCode.Text.Trim()); this.txtCode.Text = ""; if (dt.Rows.Count > 0) { DataRow dr = dt.Rows[0]; this.txtBill_No2.Text = dr["BILL_NO"].ToString(); this.txtCIGARETTE_NAME2.Text = dr["CIGARETTE_NAME"].ToString(); this.txtGRADE_NAME2.Text = dr["GRADE_NAME"].ToString(); this.txtORIGINAL_NAME2.Text = dr["ORIGINAL_NAME"].ToString(); this.txtScanCode.Text = dr["PRODUCT_BARCODE"].ToString(); this.txtSTYLE_NAME2.Text = dr["STYLE_NAME"].ToString(); this.txtWeight2.Text = dr["WEIGHT"].ToString(); } } }