Jump to content

vb codes error


zhenxin

Recommended Posts

hi. im getting this error called "Index was out of range. Must be non-negative and less than the size of the collection."i was doing up a simple forum using vs2005. i was trying to link the respective threads to respective topics and from the topics to its respective messages.For the linking of the threads to respective topics it succeed. But when i wanted to link the topics to its respective messages, it return mi the above error.May i know how to solve this error??

Link to comment
Share on other sites

What that error is telling you is that you have attempted to access an element in a collection using an index that was outside of the range of allowed indexes for that collection.For example, if you were storing your messages in an array and you had 10 messages, the indexes of 0 through 9 would return an element from your array. Attempting to use -1 or any number greater than 9 would cause that exception to occur.Just make sure that you are using an index that is less than the size of the collection and is greater than -1.

Link to comment
Share on other sites

Let take this forum for example.i gt a source code which will link the topic to respective messages (eg. http://w3schools.invisionzone.com/index.php?showtopic=19885)But then how can i link the thread to respective topics as in this casehttp://w3schools.invisionzone.com/index.php?s=06ff120f6151fd81a2ba49abba3b9172&showforum=28 how to get the code to pass in the parameter as shown above in blue?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...