Solved

How to retrieve data from a row in a dataset

Posted on 2006-11-14
3
215 Views
Last Modified: 2010-04-17
Server Error in '/ItemQuotes' Application.

--------------------------------------------------------------------------------

There is no row at position 6.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IndexOutOfRangeException: There is no row at position 6.

Source Error:

 
Line 109:                          if (cnt > 0)
Line 110:                          {
Line 111:                                   txtProductId.Text = Convert.ToString(dsproductvendorList.Tables[0].Rows[rowcount]["id"]);
Line 112:                                   txtVendorName.Text = Convert.ToString(dsproductvendorList.Tables[0].Rows[rowcount]["vendor_name"]);
Line 113:                                   txtKISDVendorNumber.Text = Convert.ToString(dsproductvendorList.Tables[0].Rows[rowcount]["KISD_vendor_number"]);
 


Source File: c:\inetpub\wwwroot\itemquotes\productvendor_tb_edit.aspx.cs    Line: 111

Stack Trace:

 
[IndexOutOfRangeException: There is no row at position 6.]
   System.Data.DataRowCollection.get_Item(Int32 index)
   ItemQuotes.Productvendor_Tb_Edit.itemsDataBind() in c:\inetpub\wwwroot\itemquotes\productvendor_tb_edit.aspx.cs:111
   ItemQuotes.Productvendor_Tb_Edit.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\itemquotes\productvendor_tb_edit.aspx.cs:55
   System.Web.UI.Control.OnLoad(EventArgs e)
   System.Web.UI.Control.LoadRecursive()
   System.Web.UI.Page.ProcessRequestMain()
 

 


--------------------------------------------------------------------------------

Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032
0
Comment
Question by:kwcowboy1226
  • 2
3 Comments
 
LVL 6

Accepted Solution

by:
riyazthad earned 500 total points
ID: 17943112
you may try to retrive row which are out of range.

dsproductvendorList.Tables[0].Rows[rowcount]["id"])

check value of rowcount and make sure there is data in that row.

0
 

Expert Comment

by:Michelle_Pitter
ID: 17949211
I'm not sure if this is going to help but I had the same sort of error and it was all down to the fact that i forgot to set a primary key up in the database table the data was stored in.
0
 
LVL 6

Expert Comment

by:riyazthad
ID: 17956036
could you solve?
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

746 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now