How can I fetch data from database to show in table cells not in grid.

Recommended Answers

All 2 Replies

Fetch/read a record and write it into response buffer.

StringBuilder sb=new StringBuilder();
sb.append("<table>");
...
sb.append("<tr><td>" + value1 + "</td></tr>");
...
sb.append("</table>");

....
Label1.Text=sb.ToString();

for runtime binding data get data from database and using foreach loop make string or use stringbuilder and bind data as per your needs and save in division, label control or in literal control like
literal.text = "<table....>databasevalue</table>"

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.