上一页 1 2 3 4 5 6 ··· 15 下一页
摘要: --构造测试数据: 只作演示用CREATE TABLE [dbo].[Tim_LinqTable]([Id] int PRIMARY KEY IDENTITY(1,1) NOT NULL,[Name] [varchar](50) NOT NULL,[Parent] int NOT NULL,)GOINSERT INTO [Tim_LinqTable] SELECT 'A',0 UNION ALLSELECT 'A1',1 UNION ALLSELECT 'A2',1 UNION ALLSELECT 'B1',2 UNION ALL 阅读全文
posted @ 2014-01-25 11:25 zhangsir 阅读(410) 评论(0) 推荐(0) 编辑
摘要: 打开Sql server management studio并新建一个查询,在打开的XXX.SQL文件中输入:execsp_MSforeachtable @command1='Delete from ?'execsp_MSforeachtable @command1 = "TRUNCATE TABLE ?"然后执行语句。------------------------------------------------------------------------------------------如果由于外键约束删除table失败,则先删除所有约束:--/第 阅读全文
posted @ 2014-01-25 11:17 zhangsir 阅读(1424) 评论(0) 推荐(0) 编辑
摘要: --允许对系统表进行更新 exec sp_configure 'allow updates',1 reconfigure with override GO --取消标识列标记 update syscolumns set colstat = 0 where id = object_id('tablename') and colstat = 1 GO --插入id=8001-8003的行 --恢复标识列标记 update syscolumns set colstat = 1 where id = object_id('tablename') and 阅读全文
posted @ 2014-01-22 20:47 zhangsir 阅读(412) 评论(0) 推荐(0) 编辑
摘要: 服务器安全设置1、系统盘和站点放置盘必须设置为NTFS格式,方便设置权限。2、系统盘和站点放置盘除administrators 和system的用户权限全部去除。3、启用windows自带防火墙,只保留有用的端口,比如远程和Web、Ftp(3389、80、21)等等,有邮件服务器的还要打开25和130端口。4、安装好SQL后进入目录搜索 xplog70 然后将找到的三个文件改名或者删除。5、更改sa密码为你都不知道的超长密码,在任何情况下都不要用sa这个帐户。6、改名系统默认帐户名并新建一个Administrator帐户作为陷阱帐户,设置超长密码,并去掉所有用户组。(就是在用户组那里设置为空即 阅读全文
posted @ 2014-01-06 15:54 zhangsir 阅读(117) 评论(0) 推荐(0) 编辑
摘要: #region 导出CSV下载 string exportFileName = "Export" + DateTime.Now.ToString("yyyyMMddHHmmss"); System.Web.HttpContext context = System.Web.HttpContext.Current; StringBuilder sb = new StringBuilder(); sb.Append("FirstName,LastName,PhoneNo.,State,TimeZone,ZipCode\n"); ... 阅读全文
posted @ 2013-12-24 13:58 zhangsir 阅读(2119) 评论(0) 推荐(0) 编辑
摘要: //需要引用命名空间,System.Diagnostics Stopwatch watch = new Stopwatch(); //实例化一个计时器 watch.Start(); //开始计时 #region 即将测试的代码段 int sum = 0; for (int i = 0; i < 10000; i++) { for (int j = 0; j < 10000; j++) { s... 阅读全文
posted @ 2013-12-20 11:55 zhangsir 阅读(778) 评论(0) 推荐(0) 编辑
摘要: /// /// Get the no repeat random array /// /// The min value of this random array /// The max value of this random array /// The result ranodm array's length /// The result random array static int[] GetNoRepeatRandomArray(int minNumber, int maxNumbe... 阅读全文
posted @ 2013-12-17 14:08 zhangsir 阅读(225) 评论(0) 推荐(0) 编辑
摘要: /// /// List转成json /// /// /// /// /// public static string ListToJson(IList list, string jsonName){ StringBuilder Json = new StringBuilder(); if (string.IsNullOrEmpty(jsonName)) jsonName = list[0].GetType().Name; Json.Append("{/"" + jsonName + "/":["); if (list.Count & 阅读全文
posted @ 2013-12-11 11:44 zhangsir 阅读(594) 评论(0) 推荐(0) 编辑
摘要: 错误原因: 主要是是MYSQL 5.1的一个BUG,其出现原因是mysql 5.1和mysql 5.0在处理到索引语句时有所区别。案例: 有时导入mysql会提示如下错误: ERROR 1064 (42000) at line 486: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘USING BTREE, KEY `Reference_1_FK` (`RoleI... 阅读全文
posted @ 2013-10-31 14:20 zhangsir 阅读(580) 评论(0) 推荐(0) 编辑
摘要: private void btnOpenFile_Click(object sender, EventArgs e) { string _FilePath = this.txtFileFullPath.Text.Trim(); if (File.Exists(_FilePath)) { //打开指定文件 System.Diagnostics.Process.Start(_FilePath); } } ... 阅读全文
posted @ 2013-10-25 11:54 zhangsir 阅读(501) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 15 下一页