?
Solved

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

Posted on 2009-06-29
4
Medium Priority
?
264 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

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

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.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

765 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