2013年9月18日
摘要: 一,select @@identityinsert into table_1 (name) values('张三');select @@identity @@identity是表示的是最近一次向具有identity属性(即自增列)的表插入数据时对应的自增列的值,是系统定义的全局变量。一般系统定义的全局变量都是以@@开头,用户自定义变量以@开头。比如有个表A,它的自增列是id,当向A表插入一行数据后,如果插入数据后自增列的值自动增加至101,则通过select @@identity得到的值就是101。使用@@identity的前提是在进行insert操作后,执行select @@ 阅读全文
posted @ 2013-09-18 11:17 小小乌龟把头藏 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 刚写的SQLHelper,已经验证。使用这个帮助类有个条件,那就是实体类的公开属性必须和数据库的字段对应(忽略大小写),否则通过实体类反射数据库的字段将会对应不上,结果你懂的using System;using System.Data;using System.Xml;using System.Data.SqlClient;using System.Collections;using System.Text.RegularExpressions;using System.Collections.Generic;using System.Reflection;using System.Confi 阅读全文
posted @ 2013-09-18 10:55 小小乌龟把头藏 阅读(290) 评论(0) 推荐(0) 编辑