关于返回最新ID的问题
private string SaveBase()
{
string rID = null;
using(SqlConnection conn = new SqlConnection(conStr))
{
using(SqlCommand cmd = new SqlCommand( "insert into HouseInfo (H_Tag,H_Address,H_Remark,H_Method) values (@H_Tag,@H_Address,@H_Remark,@H_Method) ",conn))
{
conn.Open();
cmd.Parameters.Add( "@H_Tag ",SqlDbType.VarChar);
cmd.Parameters[ "@H_Tag "].Value = H_Tag;
cmd.Parameters.Add( "@H_Address ",SqlDbType.VarChar);
cmd.Parameters[ "@H_Address "].Value = H_Address;
cmd.Parameters.Add( "@H_Remark ",SqlDbType.VarChar);
cmd.Parameters[ "@H_Remark "].Value = H_Remark;
cmd.Parameters.Add( "@H_Method ",SqlDbType.VarChar);
cmd.Parameters[ "@H_Method "].Value = H_Method;
try
{
cmd.ExecuteNonQuery();
cmd.CommandText = "select SCOPE_IDENTITY() as NID ";