01 2009 档案

摘要:1 :普通SQL语句可以用Exec执行 eg: Select * from tableName Exec('select * from tableName') Exec sp_executesql N'select * from tableName' -- 请注意字符串前一定要加N 2:字段名,表名,数据库名之类作为变量时,必须用动态SQL... 阅读全文
posted @ 2009-01-30 21:25 scgw 阅读(226) 评论(0) 推荐(0) 编辑
摘要:代码如下 declare @uid int; set @uid=7; declare @sql nvarchar(1000); set @sql='select * from [aaa] where uid= ' @uid exec(@sql) 提示 消息 245,级别 16,状态 1,第 9 行 在将 varchar 值 'select * from [aaa] where uid= ' 转... 阅读全文
posted @ 2009-01-30 21:20 scgw 阅读(3362) 评论(1) 推荐(0) 编辑
摘要:在用VS2008发布网站项目时,默认生成bin目录下的.dll文件名是随机命名的; 如果要固定生成文件名如何固定呢? 有以下两种方案: 一、每个页面的程序集分别生成对应的dll; 方法:在“发布网站”的选项中,勾选“使用固定命名和单页程序集” 二、整个站点的程序集都生成为一个文件;方法:需下载MS提供的插件,经过简单的设置可生成自定义的文件名(.dll): Web Deployment Pr... 阅读全文
posted @ 2009-01-17 14:12 scgw 阅读(1543) 评论(0) 推荐(1) 编辑
摘要:有人提议用int.Parse(string)的方法,然后通过捕获异常来判断返回的值。更好的方法是用正则表达式: public int IsNumeric(string str) { int i; if(str != n... 阅读全文
posted @ 2009-01-10 12:15 scgw 阅读(2624) 评论(0) 推荐(1) 编辑
摘要:今天使用SqlDataReader读取数据的时候,不能用,而记取全部数据的时候就能用,编辑一条的时候就不行,晕呀!!出现“在没有任何数据时进行无效的读取尝试”错误。 DataReader是只向下读取信息的 加上判断即可: if (reader.read()) { TextName.Text = reader["names"].ToString();... 阅读全文
posted @ 2009-01-03 11:53 scgw 阅读(1569) 评论(0) 推荐(0) 编辑

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示