Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

show table rows in textboxes in asp.net c#

$
0
0
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


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>