数据从后台数据库取,利使用分页控件?尽量有后台方法代码(c#),谢谢
答案满意,加赠园豆!!!
System.Collections.Generic.List<Core.DarrenAdHelper.PC> l = GetPC("LDAP://cnrdc01/OU=CN " + ",DC=cree1, DC=com"); 16: 17: if (l.Count > 0) 18: { 19: SqlConnection conn = new SqlConnection(Core.DarrenEncodeOrDecode.EncodeOrDecode.Decode(System.Configuration.ConfigurationManager.ConnectionStrings["CotwapConnectionString"].ConnectionString)); 20: string sql = sql = "delete PCInfo;"; 21: 22: if (conn.State != ConnectionState.Open) 23: conn.Open(); 24: SqlTransaction st = conn.BeginTransaction(); 25: try 26: { 27: Core.DarrenCoreLib.DB.SqlHelper.ExecuteNonQuery(st, CommandType.Text, sql); 28: 29: foreach (Core.DarrenAdHelper.PC pc1 in l) 30: { 31: sql = sql = "INSERT INTO [PCInfo]([Cn],[Description],[OperatingSystem],[OperatingSystemVersion],[OperatingSystemServicePack],[WhenCreated],[WhenChanged],[LastLogon],[LastLogoff],[DistinguishedName],[SPath]) "; 32: string[] strpath = pc1.DistinguishedName.Replace(",", "").Split(new string[] { "OU=", "DC=", "CN=" }, StringSplitOptions.RemoveEmptyEntries); 33: string spath = string.Empty; 34: for (int i = strpath.Length - 3; i >= 1; i--) 35: { 36: spath += strpath[i] + @"\"; 37: } 38: sql += " select '"; 39: sql += pc1.Cn + "','" + pc1.Description + "','" + pc1.OperatingSystem + "','" + pc1.OperatingSystemVersion + "','" + pc1.OperatingSystemServicePack + "','" + pc1.WhenCreated + "','" + pc1.WhenChanged + "','"; 40: sql += pc1.LastLogon + "','" + pc1.LastLogoff + "','" + pc1.DistinguishedName + "','" + spath + "' "; 41: Core.DarrenCoreLib.DB.SqlHelper.ExecuteNonQuery(st, System.Data.CommandType.Text, sql); 42: 43: } 44: st.Commit(); 45: } 46: catch 47: { 48: st.Rollback(); 49: } 50: finally 51: { 52: if (conn.State != ConnectionState.Closed) 53: conn.Close(); 54: Page.Response.Redirect("KillWindow.aspx"); 55: } 56: }
这儿前后台都有:http://www.cnblogs.com/yiyumeng/archive/2012/02/19/2358726.html
后台:http://www.java2s.com/Code/JavaScript/Ext-JS/ExtPagingToolbarstorepageSizedisplayInfo.htm