Click here to Skip to main content
15,896,726 members
Home / Discussions / Database
   

Database

 
GeneralRe: Remove identity property Pin
Xmen Real 18-Feb-08 14:38
professional Xmen Real 18-Feb-08 14:38 
GeneralThe right way to maintain integrity across databases Pin
martin_hughes17-Feb-08 9:56
martin_hughes17-Feb-08 9:56 
GeneralRe: The right way to maintain integrity across databases Pin
SimulationofSai17-Feb-08 22:20
SimulationofSai17-Feb-08 22:20 
QuestionHow to lock a table? Pin
Ian Uy16-Feb-08 21:27
Ian Uy16-Feb-08 21:27 
AnswerRe: How to lock a table? Pin
Colin Angus Mackay17-Feb-08 0:33
Colin Angus Mackay17-Feb-08 0:33 
GeneralRe: How to lock a table? Pin
Ian Uy17-Feb-08 0:38
Ian Uy17-Feb-08 0:38 
GeneralRe: How to lock a table? Pin
Colin Angus Mackay17-Feb-08 0:46
Colin Angus Mackay17-Feb-08 0:46 
GeneralRe: How to lock a table? Pin
Ian Uy17-Feb-08 1:29
Ian Uy17-Feb-08 1:29 
Thanks for the reply.

Can I concatenate the INSERT COMMAND and the SELECT COMMAND into a single SQLCommand object?

So instead of:
SqlCommand insert = new sqlcommand(@"INSERT ...");<br />
insert.ExecuteNonQuery();<br />
<br />
SqlCommand scope = new sqlcommand(@"select ....");<br />
int identity = (int)scope.ExecuteScalar();


It will be like:
Sqlcommand insertAndscope = new sqlcommand(@"Insert ...; Select...");<br />
int identity = (int)insertAndscope.ExecuteScalar();


What I'm afraid is that, if the command is divided into two, there is a lag time between the two commands - and in a multi-user enviroment, there will be a problem. For instance:

USER A - INSERT
USER B - INSERT
USER A - SCOPE (1 - instead of 0)
USER B - SCOPE (2 - instead of 1)

When what I want is:
User A - INSERT and SCOPE (0)
User B - INSERT and SCOPE (1)

Thanks!
GeneralRe: How to lock a table? Pin
Colin Angus Mackay17-Feb-08 1:33
Colin Angus Mackay17-Feb-08 1:33 
GeneralRe: How to lock a table? Pin
Ian Uy17-Feb-08 2:33
Ian Uy17-Feb-08 2:33 
QuestionGetting Stored procedures from database using ADOX Pin
Green Fuze16-Feb-08 11:58
Green Fuze16-Feb-08 11:58 
QuestionIndex and join issue Pin
Ajeet mittal16-Feb-08 5:12
Ajeet mittal16-Feb-08 5:12 
GeneralRe: Index and join issue Pin
pmarfleet16-Feb-08 9:02
pmarfleet16-Feb-08 9:02 
QuestionFireBird Database with .Net 2.0 Pin
avvaru.murali16-Feb-08 2:56
avvaru.murali16-Feb-08 2:56 
GeneralRe: FireBird Database with .Net 2.0 Pin
pmarfleet16-Feb-08 8:55
pmarfleet16-Feb-08 8:55 
Questionhow to show row wise record column wise Pin
mohd imran abdul aziz16-Feb-08 1:26
mohd imran abdul aziz16-Feb-08 1:26 
AnswerRe: how to show row wise record column wise Pin
pmarfleet16-Feb-08 9:06
pmarfleet16-Feb-08 9:06 
Questiontrigger and procedure Pin
RajeevKumarSharma15-Feb-08 23:37
RajeevKumarSharma15-Feb-08 23:37 
GeneralRe: trigger and procedure Pin
Ashfield16-Feb-08 3:42
Ashfield16-Feb-08 3:42 
QuestionTRIGGER PROBLEM Pin
RajeevKumarSharma15-Feb-08 23:14
RajeevKumarSharma15-Feb-08 23:14 
GeneralRe: TRIGGER PROBLEM Pin
Ashfield16-Feb-08 3:40
Ashfield16-Feb-08 3:40 
GeneralERROR [42000] [Microsoft][ODBC Microsoft Access Driver] Record(s) cannot be read; no read permission Pin
Cuckoo15-Feb-08 22:54
Cuckoo15-Feb-08 22:54 
GeneralProblem in searching a self joined table Pin
Rocky#15-Feb-08 21:13
Rocky#15-Feb-08 21:13 
GeneralSybase OleDB connection help [modified] Pin
devvvy15-Feb-08 17:40
devvvy15-Feb-08 17:40 
GeneralRe: Sybase OleDB connection help [modified] Pin
ashishj01624-Jun-14 19:28
ashishj01624-Jun-14 19:28 

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.