1 using(SqlCommand cmd=new SqlCommand("INSERT INTO Mem_Basic(Mem_Na,Mem_Occ) output INSERTED.ID VALUES(@na,@occ)",con))
2 {
3 cmd.Parameters.AddWithValue("@na", Mem_NA);
4 cmd.Parameters.AddWithValue("@occ", Mem_Occ);
5 con.Open();
6
7 int modified =(int)cmd.ExecuteScalar();
8
9 if (con.State == System.Data.ConnectionState.Open)
10 con.Close();
11
12 return modified;
13 }
14}
15