DataKeys[currentRowIndex].Value works on Development Server but not IIS?

I've been working on the local development server that comes with Visual Web Developer and have the following code working properly.

However, when I move to IIS and load the page, I don't get any error messages but newsID is blank!

Any ideas??
protected void GridView1_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e)
string currentCommand = e.CommandName;
int currentRowIndex = Convert.ToInt32(e.CommandArgument);
string newsID = gv.DataKeys[currentRowIndex].Value.ToString();
Response.Write("NewsID = " + newsID);

Open in new window

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.

I know it is a dumb question but are you sure you brought your data connection over with you from the old server to the new server?
sayguhAuthor Commented:
Yes, I've updated my ConnectionString to the real SQL database
sayguhAuthor Commented:
Also, I have a deletecommand on the gridview which works on development but not on LIVE either.

It just refreshesh the page (no error message) but is not deleting the record ???

The gridview is populating with data so the database connection is definitely working..

sayguhAuthor Commented:
Ahh figured it out.  I didn't have the new database table auto-incrementing properly.

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
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

From novice to tech pro — start learning today.