i have a table name "AddFIR" , i want that when i click the button to save the record, "FIRid" Will be show on that time. e.g; "Your FIR Was Successfully Saved And Your FIR ID IS : 55" ,
anyone help me how i resolve this method?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Manas MohapatraRank #182 · 13.2K reputationPosted Nov 20, 2016, 8:18 AM EST
Bilawal Niaz84 reputationPosted Nov 20, 2016, 4:19 PM EST
Manas MohapatraRank #182 · 13.2K reputationPosted Nov 20, 2016, 8:46 PM EST
Prateek SinglaRank #1,452 · 1.1K reputationPosted Nov 20, 2016, 8:47 PM EST
Entity Framework will automatically load the last inserted id to populate the primary key column of the inserted entity:
Note that the
Idproperty only gets populated after callingSaveChanges()in case theStoreGeneratedPatternattribute is set to "Identity" or "Computed" for the auto-incremented ID column in the Storage part of the model.