Click here to Skip to main content
15,860,972 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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
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>
Sergey Alexandrovich Kryukov 26-Dec-12 2:46am    
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

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
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900