Gridview Identity Seed Value

I have a fairly standard gridview in my application.  The first column is EmpID.  I have added an insert command to my gridview by putting a blank textbox in the <FooterTemplate></FooterTemplate> of each of my columns.  When I perform the import, I want the EmpID to be read only and it to automatically increment to the next possible value in the dB.  It is set as a seed value (increments by 1) already.

Any ideas as to how I would implement this?
goodmanroAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jojo1771Commented:
If its set to auto increment, shouldn't it auto increment without any code. Just insert all the other values? I'm sorry if I'm not much help.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jojo1771Commented:
Let me ask you one more question. Is this Gridview tied to a dataset? And if so are you inserting the import to the DS or directly to the DB.
0
goodmanroAuthor Commented:
This gridview is tied to an asp:SqlDataSource.  I tried simply inserting into the dB, but I get a NullExceptionReference for the EmpID field.  Is there somthing that I could do possibly with setting a variable equal to SELECT MAXCOUNT?
0
goodmanroAuthor Commented:
Is there a way to SET IDENTITY_INSERT ON in a code behind file?  I see how this works in a SP and this could possibly be a solution...
0
goodmanroAuthor Commented:
This question has been resolved.  Thank you.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.