I am trying to use MySQL 5 with C #. I downloaded the MySQL driver on mysql.com and installed it. Now I can connect to MySQL in C # with the following code.
string ConString = "SERVER=192.168.10.104;";
ConString += "DATABASE=test;";
ConString += "UID=user;";
ConString += "PASSWORD=password;";
MySqlConnection connection = new MySqlConnection(ConString);
MySqlCommand command = connection.CreateCommand();
MySqlDataReader Reader;
command.CommandText = "select * from j_people";
connection.Open();
Reader = command.ExecuteReader();
The problem is that if I change the database server to MS SQL Server or Oracle later?
Is there a database abstraction layer in C #?
I assume that it will be ADO.NET , but I can not find a practical example of ADO.NET with MySQL.
source
share