SqlCeParameter return Auto ID (Primary Key)
问题 I have an SQL SqlCeParameter statement for example: mySQLCommand1.CommandText = @" INSERT INTO clientSubjectiveComplaints (clientSubComplaintCreated) VALUES (@ClientSubComplaintCreated) "; Once the INSERT is successful I need the auto generated ID (INT Primary Key) returned so that I can use it in a second INSERT statement. Is this possible for SqlCe ? Please if you can provide an example. 回答1: Like this: using (var connection = new SqlCeConnection(Settings.Default.Database1ConnectionString))