Loading

subscript out of range- datagrid

2 posts / 0 new
Last post
Offline
Joined: 01/23/2010
subscript out of range- datagrid

dear all, i am a beginner in VB. When i put objects, datagrid and command button to form, and i put some codes to command1_click() like this
datagrid1.columns(0).caption ="Name"
datagrid1.columns(1),caption="Address"
datagrid1.columns(2).caption="occupation"
datagrid1.columns(3).caption="Age"
when i click command1 there is an error message (run-time error 9) : "subscript out of range"
my questions are ; why could it happens and what's the solution

admin's picture
Offline
Joined: 11/14/2008
re: subscript out of range- datagrid

Show some of your code

Pages

Add new comment

Filtered HTML

  • You may insert videos with [video:URL]
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <asp>, <c>, <cpp>, <csharp>, <css>, <html4strict>, <java>, <javascript>, <mysql>, <php>, <python>, <sql>, <vb>, <vbnet>. The supported tag styles are: <foo>, [foo].
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.