Click here to Skip to main content
15,891,787 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am uses sql server for data base and i am developing a shopping website and based on selected items and quantity i want to reduce the particular selected items quantity from my database i am using datatable dt= session["byeitms"]

What I have tried:

please help me . i have tried quantity=quantity -dropdownlist1.selecteditems and many of things to solve this problems but not getting solution . please help me
Posted
Updated 11-Jan-19 2:13am
Comments
F-ES Sitecore 11-Jan-19 4:56am    
Datatables aren't very good for things like this. What you need to do is look into Entity Framework, if you google you'll find "getting started" articles or you can get a book on it. You can use Entity Framework to manipulate any data in your database you want, so reading it, updating it etc.
Member 14066382 11-Jan-19 8:17am    
ok i will try thanks

1 solution

Mr recommendation would not be doing in directly in the product DataTable directly; rather the DataTable should be refreshed at the time of view based on the product table which has the actual stock level already in it.

You have already asked and been answered on how to do this:
==> Reduce stock available from table in ASP .NET[^]

If further help is needed, it is generally recommended to include related questions so people can have a better picture of what is already going on. If this solution is not working or you don't know to implement, just say so and someone may be able to help you with that portion.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900