-
-
Save butler1233/0696979aaa068cd2b37a863b7f7a392e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public Function SelectData(query As String) | |
Dim conn As New MySqlConnection(mysqlcs) | |
Try | |
conn.Open() | |
Dim sqlquery As MySqlCommand = New MySqlCommand(query, conn) With { | |
.CommandTimeout = 0 | |
} | |
Dim returneddata As MySqlDataReader = sqlquery.ExecuteReader() | |
Dim returnme As New ArrayList | |
Dim looper As Integer = 0 | |
While returneddata.Read() | |
Dim fieldloop As Integer = 0 | |
Dim row As New ArrayList | |
row.Clear() | |
While fieldloop < returneddata.FieldCount | |
row.Add(returneddata.Item(fieldloop)) | |
fieldloop = fieldloop + 1 | |
End While | |
returnme.Add(row) | |
End While | |
Return returnme | |
Catch ex As MySqlException | |
Return ex.Message | |
Finally | |
conn.Close() | |
End Try | |
End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment