string query = "SELECT * FROM Teachers"; SqlCommand sql = new SqlCommand(query, con); var cmd = new SqlCommand(query, con); SqlDataAdapter da = new SqlDataAdapter(cmd); DataTable dt = new DataTable(); da.Fill(dt); SqlDataReader reader = sql.ExecuteReader(); int i=0; while(dt.Rows.Count>0){ TextBox3.Text = dt.Rows[i]["StartTime"].ToString(); TextBox4.Text = dt.Rows[i]["EndTime"].ToString(); i++; }
kindly any1 tell how to show table rows in textboxes in asp.net c#
The problem is that above row is only accessing last row
where as i want to access all rows in text field