-
-
Save Regenhardt/04e5cd2c3d8d668f429139db06631886 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 void SelectData(string query) | |
{ | |
MySqlConnection conn = new MySqlConnection(mysqlcs); | |
try | |
{ | |
conn.Open(); | |
MySqlCommand sqlquery = new MySqlCommand(query, conn) | |
{ | |
CommandTimeout = 0 | |
}; | |
MySqlDataReader returneddata = sqlquery.ExecuteReader(); | |
ArrayList returnme = new ArrayList(); | |
int looper = 0; | |
while (returneddata.Read()) | |
{ | |
int fieldloop = 0; | |
ArrayList row = new ArrayList(); | |
row.Clear(); | |
while (fieldloop < returneddata.FieldCount) | |
{ | |
row.Add(returneddata.Item(fieldloop)); | |
fieldloop = fieldloop + 1; | |
} | |
returnme.Add(row); | |
} | |
return returnme; | |
} | |
catch (MySqlException ex) | |
{ | |
return ex.Message; | |
} | |
finally | |
{ | |
conn.Close(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment