摘要: 首先创建一个数据库连接类:SQLHelperusing System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Data.SqlClient;using System.Data;namespace insetData{ public class SQLHelper { public static readonly string Strconn = "Data Source=LocalHost;database=CardID;uid=sa;pwd=12... 阅读全文
posted @ 2014-03-28 19:10 蜜雪粮液 阅读(1818) 评论(0) 推荐(0) 编辑
摘要: insert into Tb_People(uname,era,amount) values( '兆周','老年','10000') select @@identity --当运行完插入语句后,执行select @@identity就可得到自动生成的id --如果是sql server 最好用select SCOPE_IDENTITY() as id--因为@@identity全局的select SCOPE_IDENTITY() as id select IDENT_CURRENT ('Tb_People')select MAX( 阅读全文
posted @ 2014-03-28 14:11 蜜雪粮液 阅读(15135) 评论(1) 推荐(1) 编辑