TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
dip s
NA
256
81.4k
How to avoid data concurrency while insert/update in table using c#
May 7 2021 11:23 AM
Hi,
I am using angular 11 for UI and asp.net mvc 5 as backend coding in my web application.
I have a bill table in my sql 8 which has coulmns like
BillID - Primary key , auto generated
BillNo
ClientID and some other columns.
For every client Bill no starts with 1.
Now, BillID is primary key and auto generated but BillNo is getting calculated through coding. I am taking max bill No. for that client and add 1 to it to show next/latest bill No to user of that client.
e.g. If a client has two user A and B. Both A and B are from billing department and making bills at the same time.
Both can see latest Bill no on billing screen. e.g. bill no -25. When they both clicks save bill at the same time,
in the databse Bill no -25 goes for both the bills. BillID goes different because BillID is primary key and auto generated. But BillNo goes same. How Can I handle this Bill No duplication issue?
This is happening with other cases also like payment receipts/refund receipts in which receipts nos are going same.
How can I handle these issues.
Thank you in advance.
Be Safe.
Reply
Answers (
4
)
Set value in LocalStorage.
Set Value In TempData.