Public Sub UpdateNames(ByRef Names() As String)
Dim sql As String = "SELECT Name FROM users"
Dim cmd As MySqlCommand = New MySqlCommand(sql, Login.SQLConnection)
Dim reader As MySqlDataReader = cmd.ExecuteReader()
Do While reader.Read()
Static i As Integer = 1
ReDim Preserve Names(i)
Names(i - 1) = reader.GetString(0)
i += 1
Thanks in advance for your help!
1 Year Ago
Related Article:VB.NET - Null Reference Exception was unhandled
is a solved VB.NET discussion thread by STP_Captain_Slo that has 6 replies, was last updated 2 years ago and has been tagged with the keywords: exception, null, reference, vb.net.