-
August 18th, 2010, 06:49 AM
#1
Index was out of range
Hi folks,
I am trying to insert the data into DataGridView and I am having this exception
"Index was out of range. Must be non-negative and less than the size of the collection."!
The code is
dgv_SearchResult.Rows[0].Cells[0].Value = (Object)myProfile.UserName.ToString();
dgv_SearchResult.Rows[0].Cells[1].Value = (Object)myProfile.Description.ToString();
dgv_SearchResult.Rows[0].Cells[2].Value = (Object)myProfile.Statistics.SubscriberCount.ToString();
dgv_SearchResult.Rows[0].Cells[3].Value = (Object)myProfile.Statistics.ViewCount.ToString();
Any idea why the exception is occuring?
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|