Alireza Noori

Iran

anoori.me

Age: 28

Alireza Noori - (Website)

Bachelor of Science in Computer Science

Software developer

I’m professionally familiar with:

  • Desktop: C# (Winforms, WPF, Metro, etc.), C++, Pascal, Java and VB

  • Web: ASP.Net MVC, PHP, JavaScript, CSS, HTML

  • ...

Visit my website at: http://anoori.me/

4h
comment Locking a table during 2 statements in Entity Framework
In that case it seems like @JanneMatikainen's answer is the way to go.
4h
comment Locking a table during 2 statements in Entity Framework
Thanks. This seems to be the best and logical way to achieve what I want,
4h
awarded Benefactor
4h
accepted Locking a table during 2 statements in Entity Framework
7h
comment Locking a table during 2 statements in Entity Framework
This works but only a few quick questions: 1. Is this number unique across all the records? I wouldn't want to have multiple numbers. 2. When I converted the number to long it was a really big number. Is there a way to get this sequential? (meaning starting from 1 or sth). 3. The number I'm looking for is a 32-bit integer. Is there a way to convert this number to a smaller 32 bit int? Currently the value I'm getting is very large and I can't convert it to int via casting.
12h
comment Locking a table during 2 statements in Entity Framework
This could be a pretty neat solution. Let me try it and get back to you.
2d
comment Locking a table during 2 statements in Entity Framework
They are not that important. But I'd rather don't have any redundant data on my db.
2d
comment Locking a table during 2 statements in Entity Framework
My only issue with this is that I need a number. I can't really use timestamp :(
2d
comment Locking a table during 2 statements in Entity Framework
Is there a way to somehow get a number based on the "rowversion" or tell SQL server to use a number instead of timestamp?
2d
comment Locking a table during 2 statements in Entity Framework
I wanted to do that but I need an integer number.
2d
comment Locking a table during 2 statements in Entity Framework
This would work but how about the previous records in the database? Also how should I remove the redundant records?
2d
awarded Promoter
2d
awarded Popular Question
Apr
14
comment Locking a table during 2 statements in Entity Framework
Any news with what I'm asking for? Did you read the update?
Apr
13
comment Locking a table during 2 statements in Entity Framework
I don't need to use the DB-specific feature (meaning Identity) I just need to generate a unique number of the InvoiceNumber. I don't suggest using Identity as I don't think it's gonna work
Apr
13
comment Locking a table during 2 statements in Entity Framework
No, I don't want to change the Id. I want to change the InvoiceNumber. I send this number to bank and the bank needs a unique number for each payment.
Apr
13
revised Locking a table during 2 statements in Entity Framework
added 1300 characters in body
Apr
13
comment Locking a table during 2 statements in Entity Framework
Thanks for the answer. This will work UNTIL I need to change the ID. Please read the update above.
Apr
13
comment Locking a table during 2 statements in Entity Framework
@Flater yes, exactly. But suppose there's an entry in the DB with the Id of 1 and the InvoiceNumber of 3. When I modify this record, I need the InvoiceNumber to change to another unique number. I cannot use 3 anymore. It should be something like 4 or any number. It should only be a number and it should be unique
Apr
13
comment Locking a table during 2 statements in Entity Framework
@Flater I know how they work but for some reason I need it to change but still be unique whenever I modify the record. It's very complicated.
1 2 3 4 5