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

Please support our ASP.NET advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
Reply

Join Date: Nov 2008
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

 
0
  #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 5:55 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC