Last post Sep 06, 2015 05:45 AM by Maurice Osborn
Sep 05, 2015 06:26 PM|Maurice Osborn|LINK
I have created a MySQL database for the local host and confirmed that the connection tests as good for my website with the .NET Framework Data Provider for MySQL in Visual Studio. But, the first time that my website attempts to access a table in the database,
a server error occurs, which says: Could not open a connection to SQL Server. Why is my website looking for an SQL server when it is connected to a MySQL database? Should I be including something other than “using System.Data.SqlClient;” or adding
I have set the connection string in the web.config file as: connectionString="Data Source=.NET Framework Data Provider for MySQL;Initial Catalog=vfwd1_encdb;User id=root;Password=123;Trusted_Connection=True" /> Is this proper? What am I missing? Please
Sep 05, 2015 07:44 PM|mostafasydney|LINK
You need to reference MySql.Data in your project and use MySql.Data.MySqlClient in you code.
Please refer to:
Hope this will help.
Sep 05, 2015 08:21 PM|Maurice Osborn|LINK
Wow! I can't wait to check this out. I don't know anything about those references or MVC, but I will look into this. Thanks.
Sep 05, 2015 09:09 PM|Maurice Osborn|LINK
MySqlCommand instead of
SqlCommand as I previously used with an SQL database. So, I assume that I will need to make these changes in my code. Is there anything else that I need to do?
Sep 06, 2015 05:45 AM|Maurice Osborn|LINK
SqlCommand to that of My
SqlCommand. This worked fine wherever this type of database access occurred. But server errors occurred wherever I used the
method to submit changes to a table such as:
DataClassesDataContext db = new DataClassesDataContext();
Profile profile = new Profile();
profile.Names = Names;