How to fetch particular column form dataset?
-
Hi Plz help me,i want to match textbox value to table'a value like in below code E_CODE.when i write ds.Tables["EMPLOYEE"]["E_CODE"] it gives error like Can not apply indexing with [] to an expression of type System.Data.DataTable. I m using asp.net with C# conn.Open(); strSelect = "Select E_CODE from EMPLOYEE"; da.SelectCommand = new SqlCommand(strSelect, conn); da.Fill(ds, "EMPLOYEE"); for (int i = 0; i < ds.Tables["EMPLOYEE"].Rows.Count; i++) { if (txtECODE.Text == ds.Tables["EMPLOYEE"]["E_CODE"]) { ds.Clear(); string strSelectall = "Select * from Employee"; da.SelectCommand = new SqlCommand(strSelectall, conn); da.Fill(ds, "Employee"); GrdEmpInfo.DataSource = ds.Tables["EMPLOYEE"]; GrdEmpInfo.DataBind(); } Thanks Care Career
-
Hi Plz help me,i want to match textbox value to table'a value like in below code E_CODE.when i write ds.Tables["EMPLOYEE"]["E_CODE"] it gives error like Can not apply indexing with [] to an expression of type System.Data.DataTable. I m using asp.net with C# conn.Open(); strSelect = "Select E_CODE from EMPLOYEE"; da.SelectCommand = new SqlCommand(strSelect, conn); da.Fill(ds, "EMPLOYEE"); for (int i = 0; i < ds.Tables["EMPLOYEE"].Rows.Count; i++) { if (txtECODE.Text == ds.Tables["EMPLOYEE"]["E_CODE"]) { ds.Clear(); string strSelectall = "Select * from Employee"; da.SelectCommand = new SqlCommand(strSelectall, conn); da.Fill(ds, "Employee"); GrdEmpInfo.DataSource = ds.Tables["EMPLOYEE"]; GrdEmpInfo.DataBind(); } Thanks Care Career