I was attempting to write a few asynchronous functions for MySQL but the documentation is so poor and I couldn't find any examples. Could anyone explain the function or give an example of it:
public void GetData(string commandText, Action<IAsyncResult> mySqlCallback)
{
MySqlCommand command = mySqlConnection.CreateCommand();
command.CommandText = commandText;
IAsyncResult asyncResult = command.BeginExecuteReader();
//return command.EndExecuteReader(asyncResult);
}
public void Execute(string commandText)
{
MySqlCommand command = mySqlConnection.CreateCommand();
command.CommandText = commandText;
IAsyncResult asyncResult = command.BeginExecuteReader(0);
command.EndExecuteReader(asyncResult);
}