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
narasiman rao
NA
519
768.8k
create div dynamically using database
Dec 23 2015 10:16 PM
i want to create dynamically div using database
In database record as follows
In LatestNewsMaster table record as follows
ID Subject Description Link
1 Accounts Accounts fee page Accountsfees.aspx
2 Defects Defects mail report Defects.aspx
my code as follows
string constr = ConfigurationManager.ConnectionStrings["Reception2_DB"].ConnectionString;
using (SqlConnection con = new SqlConnection(constr))
{
sing (SqlCommand cmd = new SqlCommand("select Subject,Description,Link from LatestNewsMaster where active <> 'd'"))
{
cmd.Connection = con;
using (SqlDataAdapter sda = new SqlDataAdapter(cmd))
{
DataTable dt = new DataTable();
sda.Fill(dt);
for (int i = 0; i<dt.rows.count;> {
lblSub.Text += dt.Rows[i][0].ToString().Trim() + "
";
lbldesc.Text += dt.rows[i][1].ToString().Trim() +"
";
llbLink.Text += dt.rows[i][2].ToString().Trim() + "
";
}
}
}
When i run the above code output as follows
Accounts (Subject Displayed from the database)
Defects (Subject Displayed from the database)
Accounts fee page (Description Displayed from the database)
Defects mail report (Description Displayed from the database)
Accountsfees.aspx (Link Displayed from the database)
Defects.aspx (Link Displayed from the database)
But i want the above ouptut to be displayed as follows
Subject Description Link
Accounts Accounts fee page Accountsfees.aspx
Defects Defects mail report Defects.aspx
Reply
Answers (
2
)
Unable to cast COM object of type 'System.__ComObject'
how to upload and retrieve image from php server on WP 8.1