Hey Guys,

I have gotta problem. I want to store data into database(which i can do) from C# application.
Now the thing is every time I insert or update, I want my application to catch that transaction,
create a 'TRANSACTION ID', and store it in table. So that it would be easier for me to update
and delete the data.
Any idea how can I do this?


Thanks
Ajinkya

Create an auto incremented primary key in your sql.
Execute this sql statement.
"INSERT INTO YourTable(val1, val2, val3 ...) VALUES(@val1, @val2, @val3...); SELECT SCOPE_IDENTITY();"

The sql statement will return you the incremental primary key. You may refer this record by the returned primary key.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.