Last post Jun 23, 2017 08:37 AM by wmec
Jun 15, 2017 06:31 PM|nathan.shull|LINK
I'm creating a web application using a web form which essentially transfers data from an excel sheet to a table. I'm using the EPPlus library to do all of that, and have a working connection. My question is how do I use an already existing stored procedure
for determining my primary key, and implement that into my application? What does that look like? Sorry if this is very simple, but I am new to ASP.NET and C#. Thanks!
Jun 15, 2017 06:55 PM|PatriceSc|LINK
Which db are you using? What does this existing procedure ? Usually generating a new primary key value is a db built in feature. For example with SQL Server :
If you have been told to use an existing procedure it should already handle this correctly. Usually in case you need it, the procedure usually returns the newly inserted id (ask them how, you have multiple ways to return this value).
Or give some more details if you need further help.
Jun 23, 2017 08:37 AM|wmec|LINK
If you're using SQL server, you can define column as Identity to let database create the key for you.
If You're using Oracle, you can create a sequence for such purpose.