My C# program is able to work with existing MySQL and Access databases. Additionally, it will also create a new Access database if none exists. I am not able to get it to create a new mySQL database though.
When the program attempts to run the ExecuteNonQuery command for CREATE DATABASE, it fails because it requires an open database connection (ExecuteNonQuery requires an open and available Connection. The connection's current state is closed.) But how can you have an open connection to a database that is yet to exist?!
My code structure to create a new Access database is in this order:
1. Create the database
2. Open the database
3. Create a database table
Is this the same order that I should apply for creating a mySQL database?
Thank you to all responders.