Solved

How to retrieve data from a row in a dataset

Posted on 2006-11-14
3
226 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
[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
  • 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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Introduction to Processes

630 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