Click here to Skip to main content
15,893,588 members
Home / Discussions / C#
   

C#

 
QuestionDivide width of row datagrid in C# with screen specification ???? Pin
aa_zz16-May-11 0:53
aa_zz16-May-11 0:53 
GeneralRe: Divide width of row datagrid in C# with screen specification ???? Pin
Programm3r16-May-11 3:54
Programm3r16-May-11 3:54 
AnswerRe: Divide width of row datagrid in C# with screen specification ???? Pin
Dave Kreskowiak16-May-11 4:02
mveDave Kreskowiak16-May-11 4:02 
Questionhow to find out installed MS-office is 64-bit or 32-bit via registry? Pin
SRKSHOME15-May-11 23:17
SRKSHOME15-May-11 23:17 
AnswerRe: how to find out installed MS-office is 64-bit or 32-bit via registry? Pin
Programm3r16-May-11 2:38
Programm3r16-May-11 2:38 
GeneralRe: how to find out installed MS-office is 64-bit or 32-bit via registry? Pin
SRKSHOME16-May-11 3:36
SRKSHOME16-May-11 3:36 
GeneralRe: how to find out installed MS-office is 64-bit or 32-bit via registry? Pin
Programm3r16-May-11 3:51
Programm3r16-May-11 3:51 
GeneralRe: how to find out installed MS-office is 64-bit or 32-bit via registry? Pin
markovl16-May-11 4:39
markovl16-May-11 4:39 
GeneralRe: how to find out installed MS-office is 64-bit or 32-bit via registry? Pin
SRKSHOME17-May-11 3:53
SRKSHOME17-May-11 3:53 
AnswerRe: how to find out installed MS-office is 64-bit or 32-bit via registry? Pin
markovl16-May-11 4:43
markovl16-May-11 4:43 
QuestionStart application at specific time Pin
Pranit Kothari15-May-11 22:01
Pranit Kothari15-May-11 22:01 
AnswerRe: Start application at specific time Pin
Richard MacCutchan15-May-11 22:13
mveRichard MacCutchan15-May-11 22:13 
GeneralRe: Start application at specific time Pin
Programm3r16-May-11 2:51
Programm3r16-May-11 2:51 
AnswerRe: Start application at specific time Pin
Thomas Krojer16-May-11 21:25
Thomas Krojer16-May-11 21:25 
GeneralRe: Start application at specific time Pin
Pranit Kothari17-May-11 1:22
Pranit Kothari17-May-11 1:22 
GeneralRe: Start application at specific time Pin
Thomas Krojer17-May-11 1:33
Thomas Krojer17-May-11 1:33 
Questionneed to load image in rdlc from database ? (windows application) Pin
Nabawoka15-May-11 13:52
Nabawoka15-May-11 13:52 
AnswerRe: need to load image in rdlc from database ? (windows application) Pin
Blue_Boy15-May-11 21:21
Blue_Boy15-May-11 21:21 
QuestionDependant tables Pin
Groulien15-May-11 7:17
Groulien15-May-11 7:17 
AnswerRe: Dependant tables Pin
Blue_Boy15-May-11 8:32
Blue_Boy15-May-11 8:32 
AnswerRe: Dependant tables Pin
OriginalGriff15-May-11 9:27
mveOriginalGriff15-May-11 9:27 
You can't rely on the Max, or (necesarily) the datetime. If you do get two close-to-simultaneous updates, then there is a very good chance that the dates will be the same anyway.

Instead, do not rely on the database to ensure unique ID's - change the Id field type to Guid, and assign them yourself, before you insert the new record to the table. Advantages: you never have to search for the record you just inserted to find out the ID because you knew it before you inserted it. If you put a try-catch block round the insert, you can handle the (extremely unlikely1) event that you do get a duplicate and assign a new Guid for a retry.

I stopped using int IDs except for log entries a few years ago, and use Guid nearly exclusively.

If you must use DB assigned ints, then you can get round the problem using a stored proceedure to insert the record and return the ID, using IDENT_CURRENT: MSDN[^]


1 You are more likely to win the lottery every draw for the rest of your life than to get two matching Guids, in theory!
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.

Manfred R. Bihy: "Looks as if OP is learning resistant."

QuestionRe: Dependant tables Pin
Luc Pattyn15-May-11 9:45
sitebuilderLuc Pattyn15-May-11 9:45 
AnswerRe: Dependant tables Pin
OriginalGriff15-May-11 10:00
mveOriginalGriff15-May-11 10:00 
GeneralRe: Dependant tables Pin
Luc Pattyn15-May-11 10:12
sitebuilderLuc Pattyn15-May-11 10:12 
GeneralRe: Dependant tables Pin
Luc Pattyn15-May-11 10:00
sitebuilderLuc Pattyn15-May-11 10:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.