Solved

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

Posted on 2009-06-29
4
260 Views
Last Modified: 2012-05-07
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);
Response.End();
}

Open in new window

0
Comment
Question by:sayguh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 8

Expert Comment

by:lharrispv
ID: 24738741
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?
0
 
LVL 2

Author Comment

by:sayguh
ID: 24738814
Yes, I've updated my ConnectionString to the real SQL database
0
 
LVL 2

Author Comment

by:sayguh
ID: 24738857
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..

confused...
0
 
LVL 2

Accepted Solution

by:
sayguh earned 0 total points
ID: 24738948
Ahh figured it out.  I didn't have the new database table auto-incrementing properly.
0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question