Good day everyone i am working on a project on asp.net webform. i am using a template that has an already made table so i want to collect the table to the database so it can fetch out all the information and send it to the table.
- StringBuilder table = new StringBuilder();
- protected void Page_Load(object sender, EventArgs e)
- {
- if(!Page.IsPostBack)
- {
- SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\odt\Documents\login.mdf;Integrated Security=True;Connect Timeout=30");
- ;
- con.Open();
- SqlCommand cmd = new SqlCommand();
- cmd.CommandText = "select * from [log] ";
- cmd.Connection = con;
- SqlDataReader dt = cmd.ExecuteReader();
- if (dt.HasRows)
- {
- if (dt.Read())
- {
- }
- }
- // cmd.ExecuteNonQuery();
- con.Close();
- }
this is the html table
- <div class="box-body table-responsive no-padding">
- <table ID="tdb" class="table table-hover" >
- <tr>
- <th>IDth>
- <th>Userth>
- <th>Passwordth>

Nilesh SawardekarRank #648 · 3.7K reputationPosted May 3, 2019, 9:41 PM EDT
Anoop Kumar SharmaRank #127 · 17.4K reputationPosted May 3, 2019, 9:45 PM EDT
Oladotun Obileye86 reputationPosted May 5, 2019, 12:14 PM EDT
Manoj BhoirRank #599 · 4K reputationPosted May 5, 2019, 8:59 PM EDT