随笔分类 -  C# .Net

摘要:今天闲来无事,测试了一下用Sql分页语句,从网上找了一些数据,总结Sql分页分为5种:--写法1,not in/topselect top 50 * from pagetest where id not in (select top 9900 id from pagetest order by id)order by id--写法2,not existsselect top 50 * from pagetest where not exists (select 1 from (select top 9900 id from pagetest order by id)a where a.id=. 阅读全文
posted @ 2013-12-31 11:51 贝小贝 阅读(190) 评论(0) 推荐(0)
摘要:首先创建一个类,类名称为FileControl, /// /// 获取制定文件夹下面的文件夹 /// /// 文件夹名称 /// public static DataTable FileDirList(string FileDir) { DataTable dt = new DataTable(); dt.Columns.Add("dir_id"); dt.Columns.Add("dir_name"); ... 阅读全文
posted @ 2013-11-05 15:34 贝小贝 阅读(421) 评论(0) 推荐(0)
摘要:在网站的开发的时候,总是会用到一些前台的提示的script的代码,从项目中整理了一份常用的方法。public class Jscript { public Jscript() { // // TODO: 在此处添加构造函数逻辑 // } /// /// 跳转页面 /// /// public static void RedirectTo(string url) { Htt... 阅读全文
posted @ 2013-10-30 16:25 贝小贝 阅读(1161) 评论(0) 推荐(0)
摘要:#region 参数传递方法第一种 //参数设置方法(第一种) //SqlParameter sp = new SqlParameter("@Name", str_Name); //SqlParameter sp2 = new SqlParameter("@Pwd", str_Pwd); //cmd.Parameters.Add(sp); //cmd.Parameters.Add(sp2);#endregion//简单的一般使用第一种#region 参数传递的第二种方法(是第一种的省略传递变量) cmd.Parameters.Add(new SqlPar 阅读全文
posted @ 2013-10-23 09:07 贝小贝 阅读(237) 评论(0) 推荐(0)