Last post Sep 20, 2015 08:48 PM by Maurice Osborn
Sep 19, 2015 01:50 PM|Maurice Osborn|LINK
I have verified that the connection tests successfully to my local MySql database when I test it in Server Explorer. I specify the data source as a MySql database, the server name as localhost, the user name as Maurice, the password as 1234, and the database
name as vfwd1_encdb. In the web.config file, I defined the connection string as: “Data Source=.NET Framework Data Provider for MySQL;Initial Catalog=vfwd1_encdb;User id=Maurice;Password=1234;Trusted_Connection=False”. But I get an error whenever I execute
the code that attempts to create a new table row with data, which states: "Win32Exception (0x80004005): The network path was not found. SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL
Server. The server was not found or was not accessible." Why is this referring to an SQL server when I am attempting to connect with a MySql server? I recently installed the MySql.Data.Entity package so that I could use Entity Framework code, but it is still
trying to work with an SQL server. Why?
Sep 19, 2015 05:32 PM|Lannie|LINK
show your code attempting to make the database connection
Sep 19, 2015 06:26 PM|Maurice Osborn|LINK
Thank you for responding. Here is my Entity Framework code that attempts to insert a new row of data into my Profile table. The error occurs at the SubmitChanges command. Could “DataClassesDataContext” be referring to an SQL server? If so, how do I change it?
DataClassesDataContext db = new DataClassesDataContext();
Profile profile = new Profile();
profile.Names = Names;
Sep 19, 2015 11:04 PM|Lannie|LINK
Sep 20, 2015 08:36 PM|Maurice Osborn|LINK
Thank you for furnishing the link regarding support for Entity Framework 6.0, which I have been studying closely. But, I am having difficulty trying to understand how to configure my web.config file to accommodate it. So, I am hoping that you will help me with it.
I had previously configured a name for a connection string, which states "Data Source=.NET Framework Data Provider for MySQL” along with an Initial Catalog, User id, and password. Then, I added providerName="MySql.Data.MySqlClient" as specified in the link article. But I am having difficulty understanding the rest that deals with EntityFramework and Providers. Am I just supposed to copy the following statements as it is?
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework"/>
I have already made sure that my project was referencing the MySql.Data.Entity.EF6 assembly along with MySql.Data and MySql.Web. This was referenced when I installed the MySql.Data.Entity package. But, I do not know what to do now. Please help.
Sep 20, 2015 08:48 PM|Maurice Osborn|LINK
I attempted to include the configuration information for the EntityFramework and Providers and obtained an error that stated: Unrecognized configuration section entityFramework. What am I supposed to do now?