Auto Incriment
How to Incriment EmpId Column Value Automatically in winforms using C#.net source code?
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
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 attend4days leftRegister
Krishna GaradRank #191 · 12.8K reputationPosted Apr 1, 2011, 1:59 AM EDT
Declare @empid int
Set @empid=(Select Max(EmpId+1) From TableName)
now use this @empid for insert statement.
Suthish NairRank #92 · 22.8K reputationPosted Apr 1, 2011, 11:24 AM EDT