Click here to Skip to main content
12,506,338 members (51,552 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# C#4.0
Actually I'm trying to upload an excel to the DB.I created one table and i'm trying to fill that table from that excel.
Posted 25-Dec-12 20:04pm
Comments
Orcun Iyigun 26-Dec-12 2:11am
   
Show us some code.. I feel like your datatable or dataset has no data.So basically this error states that the datasource(DataTable) is not having any rows. To avoid this exception use this before you read or loop through datatable:

<pre lang="c#">if(dt.Rows.Count > 0 ){
//Do your stuff here.
}</pre>
   
I basically answered, but I would up-vote your comment if you make it an answer.
—SA
Orcun Iyigun 26-Dec-12 4:38am
   
I think yours is enough too. But thank you though :)
Sergey Alexandrovich Kryukov 26-Dec-12 12:25pm
   
:-)

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

There is not enough information to explain what's going on in detail, but normally, the phrase "there are no row at position 0" is some exception message means that there is zero number of rows. As simple as that.

Please understand that in all cases you need to present comprehensive exception information as well as the code sample where this exception is thrown. One critical part of the question would be indication of exact code line where it happens. It's the best to do it by commenting this line accordingly.

—SA
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160927.1 | Last Updated 26 Dec 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100