Public Datatable showpage ( Int Pageindex, Int Pagesize)
{
String Strsql = Configurationmanager. connectionstrings [ " Pagetestconnectionstring " ]. Tostring ();
Sqlconnection con = New Sqlconnection (strsql );
Con. open ();
String SQL = " Select top " + Pagesize + " * From newstest n where PID not in (select top " + (Pageindex - 1 ) * Pagesize + " PID from newstest) " ;
Sqldataadapter SDR = New Sqldataadapter (SQL, con );
Datatable dt = New Datatable ();
SDR. Fill (DT );
Con. Close ();
Return DT;
}
Public Int Showpagecount ()
{
String Strsql = Configurationmanager. connectionstrings [ " Pagetestconnectionstring " ]. Tostring ();
Sqlconnection con = New Sqlconnection (strsql );
Con. open ();
String SQL = " Select count (*) from newstest " ;
Sqlcommand cmd = New Sqlcommand (SQL, con );
Int I = Convert. toint32 (CMD. executescalar ());
Con. Close ();
Return I;
}