TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Oladotun Obileye
NA
98
19.3k
how to connect database to bootstrap html table in asp webfo
May 4 2019 1:34 AM
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
>
ID
</
th
>
<
th
>
User
</
th
>
<
th
>
Password
</
th
>
Reply
Answers (
4
)
Want to Add User Privilleges on Azure storage Using Asp.net
To Get Default Page Value from Web.config file