What does MySqlDataAdapter.Fill return when the results are empty?
- by Brian
I have a 'worker' function that will be processing any and all sql queries in my program. I will need to execute queries that return result sets and ones that just execute stored procedures without any results. Is this possible with MySqlDataAdapter.Fill or do I need to use the MySqlCommand.ExecuteNonQuery() method? Here is my 'worker' function for reference:
private DataSet RunQuery(string SQL)
{
MySqlConnection connection;
MySqlCommand command;
MySqlDataAdapter adapter;
DataSet dataset = new DataSet();
lock(locker)
{
connection = new MySqlConnection(MyConString);
command = new MySqlCommand();
command = connection.CreateCommand();
command.CommandText = SQL;
adapter = new MySqlDataAdapter();
adapter.Fill(dataset);
}
return dataset;
}