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())
- {
- }
- }
-
- con.Close();
- }
this is the html table
- <div class="box-body table-responsive no-padding">
- <table ID="tdb" class="table table-hover" >
- <tr>
- <th>ID</th>
- <th>User</th>
- <th>Password</th>