[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:
mysqlAdapter.SelectCommand = mysqlComm
mysqlAdapter.Fill(mysqlTable)
mysqlReader = mysqlComm.ExecuteReader
While mysqlReader.Read
sbar_progress.Value += 1
beslag_dg_beslag.DataSource = mysqlTable
End While
Thanks for the help in advance.
Re: Index out of range (Datagridview - DataSet - MySQL)
Might be useful to mention which line of code it tells you this issue is on.
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.
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. :thumb: