Retrieve output parameter of SQL statement
问题 I'm using a table with two columns, customer_id and customer_name . customer_name is a simple varchar , customer_id is an auto incrementing primary key. I want to use my C# application to insert a customer_name , and retrieve the value of the customer_id . Just inserting is simply solved by using using (SqlConnection connection = new SqlConnection(AppConstants.ConnectionString)) { using (SqlCommand command = new SqlCommand("INSERT INTO custom_customer (customer_name) VALUES (@name);")) {