I want to build a connection to a database using the MySQL Connector. I get a connection with the assembly MySql.Data.RT.dll
but this was for Win RT. Is this also the right one for a Win 10 Universal app, or is it better to use one of the .NET 4.5 Framework:
My Question is:
Which assembly to choose for a Windows Universal App ?
To Connect to a MySQL Database Expand the Drivers node from the Database Explorer. Right-click the MySQL (Connector/J driver) and choose Connect Using.... The New Database Connection dialog box is displayed. In the Basic Setting tab, enter the Database's URL <HOST>:<PORT>/<DB> in the corresponding text field.
To add a connection, click the [+] icon to the right of the MySQL Connections title on the home screen. This opens the Setup New Connection form, as the following figure shows. The Configure Server Management button (bottom left) opens an optional configuration wizard for setting shell commands on the host.
Python needs a MySQL driver to access the MySQL database. In this tutorial we will use the driver "MySQL Connector". We recommend that you use PIP to install "MySQL Connector". PIP is most likely already installed in your Python environment.
MySql connections are happen through
MySql.Data and MySql.Data.MySqlClient
these two assemblies are most commonly used dll files for any mysql connectivity.
For Example code in C#:
MySqlConnection MYSQLCON;
MySqlDataAdapter daDataAdapter;
MySqlCommand MYSQLCmd;
public MYSQLDataAccess()
{
ConnectionStrinG = getMySqlConnectionString();
MYSQLCON = new MySqlConnection(ConnectionStrinG);
}
public string getMySqlConnectionString()
{
string CString = ConfigurationManager.AppSettings["MyCString"].ToString(); // Connection string from web.config
string ConStr = ConfigurationManager.ConnectionStrings[CString].ToString();
return ConStr;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With