Solved

How to retrieve data from a row in a dataset

Posted on 2006-11-14
3
223 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
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…

856 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