List<string> list=new List<string>();// declered the list // fetch data from the database... con.Open(); SqlCommand cmd = new SqlCommand("select AC_NAME,AC_NO from PGM_MAST where AGENT_NO=" + txt_Agnt.Text + "", con); SqlDataReader dr; dr = cmd.ExecuteReader(); while (dr.Read()) { for ( j=0; j < dr.FieldCount; j++) { list.Add(dr[j].ToString()); } txt_AC_Name.Text = list[0].ToString(); txt_AC.Text= list[1].ToString(); j++; } dr.Close(); con.Close();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)