My website is able to access a MySQL database when commands such as MySqlConnection and MySqlCommand are used. But server errors occur in my C# code wherever I use the DataClassesDataContext method to access table data such as:
DataClassesDataContext db = new DataClassesDataContext()
Profile profile = new Profile();
profile.Names = Names;
db.Profiles.InsertOnSubmit(profile);
db.SubmitChanges();
How can I make this form of data table access work with a MySQL database?
I attempted Installing and Updating NuGet Client by using the Command-Line Utility via Direct Download, but the nuget.exe file would not execute. I attempted this because this appears to only work with Visual Studio 2010, 2012, 2013 or
2015 and I only have 2008. Does this mean that I will not be able to install the Entity Framework or the Entity to make this work? Am I out of luck with this?
Obviously, if you can't or won't upgrade, you will have problems going forward. 2008 is a very old version and doesn't support a lot of what you are likely to get recommended in these forums.
You have pulled me back out of the fire again! Back in 2008, I paid a lot of money to get the 2008 version of Visual Studio. So, I expected to have to pay a lot more for the later versions. I had no idea that they were free. Thank you SO much! I have
just downloaded the 2015 version. I can’t wait to try it out. Then, I look forward to trying the installed version of the MySQL Entity Framework provider. If this works, you will be my hero forever!
Member
218 Points
513 Posts
Can DataClassesDataContext be used to access a MySQL database?
Sep 06, 2015 01:02 PM|Maurice Osborn|LINK
My website is able to access a MySQL database when commands such as MySqlConnection and MySqlCommand are used. But server errors occur in my C# code wherever I use the DataClassesDataContext method to access table data such as:
How can I make this form of data table access work with a MySQL database?
All-Star
194444 Points
28074 Posts
Moderator
Re: Can DataClassesDataContext be used to access a MySQL database?
Sep 06, 2015 03:36 PM|Mikesdotnetting|LINK
If you want to use the Entity Framework with a MySQL database, you need to install the MySQL Entity Framework provider.
http://lvasquez.github.io/2014/11/18/EntityFramework-MySql/
https://www.nuget.org/packages/MySql.Data.Entity/
Member
218 Points
513 Posts
Re: Can DataClassesDataContext be used to access a MySQL database?
Sep 06, 2015 04:46 PM|Maurice Osborn|LINK
WOW!!! You have just saved me an enormous amount of work. Thank you SO much!
Maurice
Member
218 Points
513 Posts
Re: Can DataClassesDataContext be used to access a MySQL database?
Sep 06, 2015 05:25 PM|Maurice Osborn|LINK
I attempted Installing and Updating NuGet Client by using the Command-Line Utility via Direct Download, but the nuget.exe file would not execute. I attempted this because this appears to only work with Visual Studio 2010, 2012, 2013 or 2015 and I only have 2008. Does this mean that I will not be able to install the Entity Framework or the Entity to make this work? Am I out of luck with this?
Maurice
All-Star
194444 Points
28074 Posts
Moderator
Re: Can DataClassesDataContext be used to access a MySQL database?
Sep 07, 2015 02:21 AM|Mikesdotnetting|LINK
https://www.visualstudio.com/en-us/downloads/download-visual-studio-vs.aspx
Obviously, if you can't or won't upgrade, you will have problems going forward. 2008 is a very old version and doesn't support a lot of what you are likely to get recommended in these forums.
Member
218 Points
513 Posts
Re: Can DataClassesDataContext be used to access a MySQL database?
Sep 07, 2015 03:35 PM|Maurice Osborn|LINK
Hi Mike,
You have pulled me back out of the fire again! Back in 2008, I paid a lot of money to get the 2008 version of Visual Studio. So, I expected to have to pay a lot more for the later versions. I had no idea that they were free. Thank you SO much! I have just downloaded the 2015 version. I can’t wait to try it out. Then, I look forward to trying the installed version of the MySQL Entity Framework provider. If this works, you will be my hero forever!
Maurice