How to get the SELECT SCOPE_IDENTITY() - alternative
-
I have A Sql compact database and im trying to return the ID of the record just inserted, howerver multi queries are not support, http://msdn.microsoft.com/en-us/library/system.data.sqlserverce.sqlcecommand.aspx[^] "The Data Provider for Microsoft SQL Server 2005 Everywhere Edition does not support batched queries. Commands must be in the following form:" Select * from Customers and not Select * from Customers; Select * from Orders; Any solutions on how to write an alternative?
-
I have A Sql compact database and im trying to return the ID of the record just inserted, howerver multi queries are not support, http://msdn.microsoft.com/en-us/library/system.data.sqlserverce.sqlcecommand.aspx[^] "The Data Provider for Microsoft SQL Server 2005 Everywhere Edition does not support batched queries. Commands must be in the following form:" Select * from Customers and not Select * from Customers; Select * from Orders; Any solutions on how to write an alternative?
What if you send the query to insert. Then send another query to get the identity.
CodingYoshi Visual Basic is for basic people, C# is for sharp people. Farid Tarin '07
-
What if you send the query to insert. Then send another query to get the identity.
CodingYoshi Visual Basic is for basic people, C# is for sharp people. Farid Tarin '07
-
I have A Sql compact database and im trying to return the ID of the record just inserted, howerver multi queries are not support, http://msdn.microsoft.com/en-us/library/system.data.sqlserverce.sqlcecommand.aspx[^] "The Data Provider for Microsoft SQL Server 2005 Everywhere Edition does not support batched queries. Commands must be in the following form:" Select * from Customers and not Select * from Customers; Select * from Orders; Any solutions on how to write an alternative?
-
I have A Sql compact database and im trying to return the ID of the record just inserted, howerver multi queries are not support, http://msdn.microsoft.com/en-us/library/system.data.sqlserverce.sqlcecommand.aspx[^] "The Data Provider for Microsoft SQL Server 2005 Everywhere Edition does not support batched queries. Commands must be in the following form:" Select * from Customers and not Select * from Customers; Select * from Orders; Any solutions on how to write an alternative?
use @@IDENTITY or a Stored Procedure?
Need custom software developed? I do C# development and consulting all over the United States. A man said to the universe: "Sir I exist!" "However," replied the universe, "The fact has not created in me A sense of obligation." --Stephen Crane
-
use @@IDENTITY or a Stored Procedure?
Need custom software developed? I do C# development and consulting all over the United States. A man said to the universe: "Sir I exist!" "However," replied the universe, "The fact has not created in me A sense of obligation." --Stephen Crane
-
? Sql Server CE doesn't support multiple concurrent connections. Did you try it like this? command.CommandText = "Your Insert Statement"; command.Execute(); command.Parameters.Clear(); command.Parameters.Add("@id", ..."); ... command.CommandText = "SET @id = @@IDENTITY"; command.ExecuteNonQuery();
Need custom software developed? I do C# development and consulting all over the United States. A man said to the universe: "Sir I exist!" "However," replied the universe, "The fact has not created in me A sense of obligation." --Stephen Crane