R
RA
Hi
I have the following sql:
sql = "INSERT INTO Customers (FirstName, LastName) VALUES ('New', 'test');
SELECT id FROM Customers WHERE (id = SCOPE_IDENTITY())"
myCommand.CommandText (sql, cn);
Can I use it with ExecuteScalar and by that I will get the new id(Identity)
column value?
object id = cmdsql.ExecuteScalar ();
Thanks,
Ronen
I have the following sql:
sql = "INSERT INTO Customers (FirstName, LastName) VALUES ('New', 'test');
SELECT id FROM Customers WHERE (id = SCOPE_IDENTITY())"
myCommand.CommandText (sql, cn);
Can I use it with ExecuteScalar and by that I will get the new id(Identity)
column value?
object id = cmdsql.ExecuteScalar ();
Thanks,
Ronen