MySQL Managed Providers
My application is a for church management and consists of numberous fields for data entry. How do I go about connecting the app. to a database (of any kind)? Do I use datasets?
Thanks!
My application is a for church management and consists of numberous fields for data entry. How do I go about connecting the app. to a database (of any kind)? Do I use datasets?
Thanks!
Yes you are on the right track ByteFx.Data has been acquired and made as the official managed provider for ADO.NET
For Connecting to a database you would need to use the MySqlConnection class.
Here is some sample code which will fill the dataset with data:
--
String query = "SELECT * FROM MyTable"; String ConnectionString = "Database=Test;Data Source=localhost;User Id=username;Password=pass";
MySqlConnection conn = new MySqlConnection(ConnectionString);
MySqlCommand objMySqlCommand = new MySqlCommand(query);
objMySqlCommand.set_Connection(conn);
MySqlDataAdapter adapter = new MySqlDataAdapter();
adapter.set_SelectCommand(objMySqlCommand);
DataSet dataset = new DataSet();
adapter.Fill(dataset);
--
Regards,
Vikram