摘要:
首先创建一个数据库连接类: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... 阅读全文
摘要:
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( 阅读全文