List<string> list=new List<string>();
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();
Using it shows only two records. But if I want to retrive more than two records from database then, what may I do? Give me a solution...