i want to retrive data from my database in form of table .i want that rows should be generted at the run time using loop and my data is displayted in form of table plz help.
asp
hello ,
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Pankaj PandeyPosted Jun 19, 2013, 5:35 AM
Is any specific requierment?
Jignesh TrivediPosted Jun 19, 2013, 5:04 AM
In this case you can use Jquery grid.
Please refer
http://jquerygrid.net/
http://www.jquery4u.com/plugins/10-jquery-grids/
if you are framework 4.5 user than SignalR can be help you.
Sanjeeb LenkaPosted Jun 19, 2013, 4:35 AM
Alok UniyalPosted Jun 19, 2013, 4:34 AM
First add asp:Table control in your web page where you want to display it.
Let you add a table with id "tbl"
On pageload event do this-
SqlConnection con = new SqlConnection(*/Your Connection*/);
con.Open();
SqlCommand cmd = con.CreateCommand();
cmd.CommandText = "Select * from Test";
SqlDataReader rdr = cmd.ExecuteReader();
if (rdr.HasRows)
{
TableRow tr = new TableRow();
while(rdr.Read())
{
string rowdata = rdr[0].ToString();
TableCell tc = new TableCell();
tc.Text = rowdata;
tr.Cells.Add(tc);
}
tbl.Rows.Add(tr);
}
con.Close();
ashima kukrejaPosted Jun 19, 2013, 4:27 AM
Alok UniyalPosted Jun 19, 2013, 4:22 AM
You are developing a window or web application?