I have table with items:
id | title | ordersTillNow
I want to write c# code on the button click event so that after the customer clicks on purchase button the column ordersTillNow will increase by one (++)…
Can this be done with Linq-to-SQL ? Or with SqlCommand?
Anyway …how can I do that on c# (code behind, with Linq-to-SQL or SqlCommand) ?
Assuming you’re using Linq-to-SQL, you will have a data context for your database, and an object that represents your table.
When the customers click, you’d write code something like this:
Using a
SqlCommand, you have lots of options to do this – a stored procedure, inline SQL – whatever.You’ll write code something like this: