博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2009年3月13日

摘要: 利用SqlDataAdapter更新数据表可以对一张表进行多个操作后,一次更新到数据库中。代码如下: SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["MyConnectString"].ConnectionString); string str = "select * from stu";... 阅读全文

posted @ 2009-03-13 00:08 Nove 阅读(1347) 评论(1) 推荐(0) 编辑

2008年1月2日

摘要: 1、往数据库中添加,修改 bit 类型的字段时,只能用 0 或者 1。 2、在sql中判断时:也只能用 0 或者 1,比如 "where bFlag=1" 不能用 "where bFlag=TURE"。 3、bit数据读出后再判断要用bool:在使用RecordSet 将bit字段的数据取出来后,转换为了 Boolean 类型。这个时候判断要用 TRUE 和 F... 阅读全文

posted @ 2008-01-02 19:32 Nove 阅读(2203) 评论(1) 推荐(0) 编辑

2007年12月19日

摘要: 1、你写一个方法,到页面上: StrLength 这个方法就是处理字符串的,写到cs文件中。 protected string StrLength (string str) { if (str.Length > 10) { return str.Substring(0, 10) + "..."; } else { return str; } } GridView 中用模板列... 阅读全文

posted @ 2007-12-19 11:04 Nove 阅读(467) 评论(2) 推荐(0) 编辑