日期:2014-05-17 浏览次数:20467 次
public class Provider:IProvider
{
private string connectionString;
public string ConnectionString {
get {
return connectionString;
}
}
public Provider() {
connectionString = ConfigurationManager.AppSettings.Get("ConStr");
}
public List<User> getlist(User user,int rp,int page,ref int count)
{
string sql = string.Empty;
sql += "select TOP (@pagesize) * from [tb_User]";
sql += " where UserID>isnull((";
sql += "select MAX(UserID) from (";
sql += "select TOP (@pagesize*(@page-1)) UserID from [tb_User] ORDER BY UserID ASC)n),0)";
sql += " and RealName like '%@RealName%'";
sql += " ORDER BY UserID ASC";
SqlParameter[] paras = {
new SqlParameter("@pagesize",rp),
new SqlParameter("@page",page),
new SqlParameter("@RealName",user.RealName)};
List<User> list = new List<User>();
&nbs