Click here to Skip to main content
15,888,293 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionExtend WebMethod Pin
Santhosh Natarajan26-Aug-12 22:13
Santhosh Natarajan26-Aug-12 22:13 
SuggestionRe: Extend WebMethod Pin
pramod.hegde27-Aug-12 2:27
professionalpramod.hegde27-Aug-12 2:27 
GeneralRe: Extend WebMethod Pin
Santhosh Natarajan27-Aug-12 3:09
Santhosh Natarajan27-Aug-12 3:09 
QuestionPage_Load(MasterPage) : can't use control-reference here? Pin
StefanUtrecht26-Aug-12 5:42
StefanUtrecht26-Aug-12 5:42 
QuestionRe: Page_Load(MasterPage) : can't use control-reference here? Pin
Eddy Vluggen27-Aug-12 0:29
professionalEddy Vluggen27-Aug-12 0:29 
AnswerRe: Page_Load(MasterPage) : can't use control-reference here? Pin
StefanUtrecht27-Aug-12 21:43
StefanUtrecht27-Aug-12 21:43 
GeneralRe: Page_Load(MasterPage) : can't use control-reference here? Pin
Eddy Vluggen27-Aug-12 22:40
professionalEddy Vluggen27-Aug-12 22:40 
QuestionC# web obtain key value after update table Pin
sc steinhayse24-Aug-12 13:31
sc steinhayse24-Aug-12 13:31 
In a C# 2010 web form application, I am trying to determine how and/or when I can obtain the identity key that was inserted into a table for a report that needs to be generated.

Basically in a linq to sql connection that connects to a sql server 2008 r2 database I have code that looks like the following:

db.Trans.InsertOnSubmit(trn);
db.Custs.InsertOnSubmit(cust);
db.SubmitChanges();
create_customer_report();


Basically in the line of code:
db.Trans.InsertOnSubmit(trn);

A new row is setup in the table called Trans. I do not believe the key to the table is actually updated in the database until the submitchanges() call is made.
In the line of code:
create_customer_report();

I need to add a line to the report in the create_customer_report method that includes the key to the table that was just inserted into the table from the code above.


I am concerned that I might not get the correct by doing a select max(key) from tran table since other users could be updating the table almost simultaneously in a different thread.

Thus my question is how can I obtain the key to the Trans table for the row that was just inserted into the table and have it appear on the customer_report?
AnswerRe: C# web obtain key value after update table Pin
Eddy Vluggen27-Aug-12 0:28
professionalEddy Vluggen27-Aug-12 0:28 
Questionnet_io_connectionclosed error in asp.net Pin
ashwani Kumar Una23-Aug-12 21:22
ashwani Kumar Una23-Aug-12 21:22 
AnswerRe: net_io_connectionclosed error in asp.net Pin
David Mujica24-Aug-12 2:15
David Mujica24-Aug-12 2:15 
AnswerRe: net_io_connectionclosed error in asp.net Pin
Sandip.Nascar24-Aug-12 8:25
Sandip.Nascar24-Aug-12 8:25 
Questionwhy is net_io_connectionclosed error in asp.net Pin
ashwani Kumar Una23-Aug-12 21:22
ashwani Kumar Una23-Aug-12 21:22 
QuestionCreate DataBase Pin
ANJYR23-Aug-12 8:30
ANJYR23-Aug-12 8:30 
AnswerRe: Create DataBase Pin
Wes Aday23-Aug-12 8:54
professionalWes Aday23-Aug-12 8:54 
AnswerRe: Create DataBase Pin
Sandip.Nascar23-Aug-12 10:36
Sandip.Nascar23-Aug-12 10:36 
QuestionApplication variable with sync Pin
anishkannan23-Aug-12 3:20
anishkannan23-Aug-12 3:20 
AnswerMS-SQL can provide custom lock management facility Pin
David Mujica23-Aug-12 3:56
David Mujica23-Aug-12 3:56 
QuestionApprove button in E-mail Pin
Ramkumar_S22-Aug-12 16:04
Ramkumar_S22-Aug-12 16:04 
AnswerRe: Approve button in E-mail Pin
Paul Conrad22-Aug-12 16:12
professionalPaul Conrad22-Aug-12 16:12 
AnswerRe: Approve button in E-mail Pin
Ain Ronquillo22-Aug-12 20:10
Ain Ronquillo22-Aug-12 20:10 
QuestionEncrypting Database Credentials Pin
indian14322-Aug-12 15:20
indian14322-Aug-12 15:20 
AnswerRe: Encrypting Database Credentials Pin
Paul Conrad22-Aug-12 16:08
professionalPaul Conrad22-Aug-12 16:08 
AnswerRe: Encrypting Database Credentials Pin
Niladri_Biswas22-Aug-12 18:48
Niladri_Biswas22-Aug-12 18:48 
QuestionAsp.Net - Oracle Connection failed Pin
lalithafranklyn22-Aug-12 9:46
lalithafranklyn22-Aug-12 9:46 

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.