sql="insert into table(name) values(‘Tom’);select @@IDENTITY"
Dim id as Int32 = CType(cmd.ExecuteScalar(conn, CommandType.Text, sql),Int32)
Dim id as Int32 = CType(cmd.ExecuteScalar(conn, CommandType.Text, sql),Int32)
if DB is publisher or subscript ==> select SCOPE_IDENTITY()
沒有留言:
張貼留言