Click here to Skip to main content
14,924,733 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can I enable pagination in a html table in yui(yahoo user interface)? This table takes data from a sql database. I have attached the c#.net code for creating the table here.

Kindly reply asap. :confused::confused:
SqlConnection cnn = new SqlConnection("Server=.;Initial Catalog = AdventureWorksDW;Integrated Security =True");
string qry = "SELECT top 100 [fldname1],[fldname2],[fldname3],[fldname4],[fldname5],[fldname6] FROM [Customer]";
SqlCommand cmd = new SqlCommand(qry, cnn);
cmd.Connection.Open();
SqlDataReader myReader = cmd.ExecuteReader(CommandBehavior.CloseConnection);
string strTable = "<table class='datatable'>";
strTable += "<thead>";
strTable += "<tr><th id='customerkey'>CustomerKey</th><th ><a href='javascript:display(this,\"firstname\")'>FirstName</a></th><th id='lastname'>Lastname</th><th  id='BirthDate'>DOB</th><th id='MaritalStatus'>Marital Status</th><th id='EmailAddress'>Email</th></tr>";
strTable += "</thead>";
strTable += "<tbody>";
while (myReader.Read())
{
  strTable += "<tr><td>" + myReader[0].ToString() + "</td><td>" + myReader[1].ToString() + "</td><td>" + myReader[2].ToString() + "</td><td>" + myReader[3].ToString() + "</td><td>" + myReader[4].ToString() + "</td><td>" + myReader[5].ToString() + "</td></tr>";
}
myReader.Close();
strTable += "</tbody></table>";
Response.Write(strTable);
Posted
Updated 21-Nov-10 21:16pm
v5
Comments
JF2015 22-Nov-10 3:06am
   
Edited for spelling and formatting. Please don't use phrases like "asap" - this won't help you in getting a fast response and is considered rude!

   
thanks for the reply...i gt it to work using YAHOO USER INTERFACE and javascript.Actually i had to use just the html table and not the gridview or the listview.

Regards,
Manu. :) :-D

:thumbsup:
   
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900