Solved

How to retrieve data from a row in a dataset

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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
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 …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

821 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