RSS Forums RSS

Index was out of range. Must be non-negative and less than the size of the collection

Reply
Posts: 1
Reputation: kausar4u is an unknown quantity at this point 
Solved Threads: 0
kausar4u kausar4u is offline Offline
Newbie Poster

Index was out of range. Must be non-negative and less than the size of the collection

  #1  
Nov 12th, 2008
  1. singlecourse = Session("singlecourse")
  2. ename.Text = singlecourse.CourseName
  3. Session("testname") = singlecourse.CourseName
  4. Seclist = que.GetSection(singlecourse.CourseCode)
  5. Qnolist = que.GetQnumber(singlecourse.CourseCode)
  6. Session("totsec") = Seclist
  7. Session("totqno") = Qnolist
  8. Session("queslist") = queslist
  9. t1.Text = Profile.Ttime
  10. pos = InStr(t1.Text, ":")
  11. h1.Value = t1.Text.Substring(0, pos - 1)
  12. 'h2.Value = t1.Text.Substring(pos, 2)
  13. h2.Value = Right(t1.Text, t1.Text.Length - pos)
  14. End If
  15. Else
  16. ViewState("qno") = CType(Session("summary"), Integer)
  17. Session("summary") = ""
  18. summbtn.Visible = True
  19. queslist = Session("queslist")
  20. ename.Text = Session("testname")
  21. t1.Text = Session("etime")
  22. pos = InStr(t1.Text, ":")
  23. h1.Value = t1.Text.Substring(0, pos - 1)
  24. h2.Value = t1.Text.Substring(pos, 2)
  25. End If
  26.  
queserial.Text = "Question : " + CType(queslist.Item(ViewState("qno")).QNo, String) & " of " & queslist.Count(Error : Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index)
aquestion.Text = queslist.Item(ViewState("qno")).Question
Last edited by peter_budo : Nov 12th, 2008 at 4:55 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
AddThis Social Bookmark Button
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.



Views: 1383 | Replies: 0 | Currently Viewing: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 3:09 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC