摘要:在 SQL Server 2000中我们可以创建一些临时存储过程来解决一些问题。如对一些表进行分页排序显示时。如:我们要求对一个表进行全字段 的分页排序,而且这个表的数据量比较大。就很难使用 DataSet 来进行。这样我们可以使用 临时存储过程 来实现这类要求。一个表: Create Table T_users(??? F_id int IDENTITY(1,1) not null,??? F_userName nvarchar(50) not null,??? F_age int,??? F_UID nvarchar(18)) 要求:用一个分页程序显示用户的信息,点击不同的字段进行排序分页。  public class DataProvider{protected UserCollection Data_UserPages(string column_name,int pageIndex,int pageSize,bool desc){UserCollection users = new UserCollection();User user;SqlConnection oConn = new SqlConnection (ConnectionString) SqlCommand oComm = new SqlCommand();oConn.open ();oComm.Connection =oConn;oComm.CommandType = CommandType.Text ;oComm.CommandText ="Create PROCEDURE #userPage\nAS\nDeclare @PageLowerBound int\nDeclare @PageUpperBound int\nDeclare @AllPage int\nset @AllPage=0\nset @PageLowerBound = "+ (pageIndex * pageSize).ToString() +"\nset @PageUpperBound = "+ (pageIndex * pageSize + pageSize +1 ).ToString() +"1\nCreate Table #PageIndex\n(\nIndexId int Identity (1,1) not null,\nuserId int\n)\ninsert into #PageIndex (userId)\nselect F_id from T_users order by "+ column_name......[阅读全文]