Results 1 to 4 of 4

Thread: [RESOLVED] Index out of range (Datagridview - DataSet - MySQL)

  1. #1

    Thread Starter
    PowerPoster Radjesh Klauke's Avatar
    Join Date
    Dec 2005
    Location
    Sexbierum (Netherlands)
    Posts
    2,244

    Resolved [RESOLVED] Index out of range (Datagridview - DataSet - MySQL)

    Ola,

    Having me a weird issue, which I can't seem to solve. I'm loading a table from a MySQL-server, which loads fine, but I also get the following error:
    Error 5: Index was out of range, Must be non-negatives and less then the size of the collection.
    Parameter name: index

    I don't understand where it comes from and what it means.

    This is how I load the database:

    vb.net Code:
    1. mysqlAdapter.SelectCommand = mysqlComm
    2. mysqlAdapter.Fill(mysqlTable)
    3. mysqlReader = mysqlComm.ExecuteReader
    4.  
    5. While mysqlReader.Read
    6.     sbar_progress.Value += 1
    7.     beslag_dg_beslag.DataSource = mysqlTable
    8. End While

    Thanks for the help in advance.


    If you found my post helpful, please rate it.

    Codebank Submission: FireFox Browser (Gecko) in VB.NET, Load files, (sub)folders treeview with Windows icons

  2. #2
    PowerPoster
    Join Date
    Mar 2002
    Location
    UK
    Posts
    4,780

    Re: Index out of range (Datagridview - DataSet - MySQL)

    Might be useful to mention which line of code it tells you this issue is on.

  3. #3

    Thread Starter
    PowerPoster Radjesh Klauke's Avatar
    Join Date
    Dec 2005
    Location
    Sexbierum (Netherlands)
    Posts
    2,244

    Re: Index out of range (Datagridview - DataSet - MySQL)

    It doesn't. I get this error in the exception... hmm... let me remove it. Stupid that I didn't think of that before. I'll be back with result.


    If you found my post helpful, please rate it.

    Codebank Submission: FireFox Browser (Gecko) in VB.NET, Load files, (sub)folders treeview with Windows icons

  4. #4

    Thread Starter
    PowerPoster Radjesh Klauke's Avatar
    Join Date
    Dec 2005
    Location
    Sexbierum (Netherlands)
    Posts
    2,244

    Re: Index out of range (Datagridview - DataSet - MySQL)

    It seemed that it didn't have anything to do with the database. I'm calling an event in the datagrid_selectionchange, whiched caused the error. Thanks for thinking with me.


    If you found my post helpful, please rate it.

    Codebank Submission: FireFox Browser (Gecko) in VB.NET, Load files, (sub)folders treeview with Windows icons

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width