Click here to Skip to main content
15,881,687 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have an old web site began with asp.net 2.0 with Visual Studio 2005 and upgraded over the years to 4.5. The original database is still used and it is sql server. I'm changing the website project to a web application and migrating to MySql. I have converted the original sql server database to MySql. And I notice that some of the tables are different from VS 2013 (or something close) generated database. Is there a simple way to convert the tables to the different format?

What I have tried:

I am searching for a readily available solution. If nothing exists, then I will manually do the transformation.
Posted
Updated 8-May-21 5:09am
v2
Comments
Dave Kreskowiak 7-May-21 22:18pm    
ASP.NET has nothing to do with databases, so your question doesn't make sense.

ASP.NET solely generates HTML for a browser client and takes interaction back from the client.
BobbyStrain 7-May-21 23:13pm    
So, the question should have been about Visual Studio database creation.
Richard MacCutchan 8-May-21 6:00am    
"I notice that some of the tables are different from VS 2013 (or something close) generated database."
That does not really give us any clue as to what your problem is.
BobbyStrain 8-May-21 11:05am    
I will follow OriginalGriff's advice. I have converted the Sql Server database to MySql. And now I will edit it. I am at the point if I deactivate the Role Provider, the connection works fine. Your help is always appreciated.

Database aren't anything to do with .NET - particularly Server based databases, which run as a separate process, often on a separate machine to the application and / or VS.

While it is possible to create tables in VS, it's a clumsy tool and most DBs are created in SSMS or teh MySql equivalent (MySql equivalent for ssms - Google Search[^] may help here)

If your tables are "different between MySql and MsSql" then you need to look very closely at why, and at how you created them - some of the datatypes are slightly different, but they cover the same range of data storage.

That doesn't mean that your application will work the same without changes other than the connection string - it won't. You need to swap it from SqlConnection, SqlCommand, and such like classes to their MySql equivalents, as well as changing your connection strings, checking your SP's, Triggers, and so forth.

One thing you could do is try exporting your Sql Server DB as a set of CREATE commands, and then modifying those to match what MySql expects.

And we can't do any of that for you: we don't have any access to your data, much less your code!
 
Share this answer
 
Comments
BobbyStrain 8-May-21 11:13am    
Thanks. I am to the point where I have a query to build the converted database in MySql. I'll edit the query so that it conforms to the required MySql version. I am curious, however, about the difference in database schemas generated by different versions of VS. Where might I look to find more about this?
There is no conversion tool inside Visual Studio, or anywhere. If you're going to use the designer in Visual Studio, gulp!, you're going to have to recreate the database using the MySql provider instead of SQL Server.

Frankly, the designers are decent for someone who doesn't know databases at all, and are doing something simple. But that's it. For everyone else, who do know databases, we just write the code by hand because it's quicker and with a better debugging experience.

The designers hide so much of what's going on in "designer generated code", that it makes it difficult to debug if you want to make changes.
 
Share this answer
 
Comments
BobbyStrain 8-May-21 12:24pm    
Thank you, Dave. I know about databases to do small chores. For this project I'll edit the queries to get what I need. And you're right about VS hiding lots of stuff. But I manage to muddle through. My last challenge was to add a condition to the VS login control. Everything was hidden.
BobbyStrain 19-May-21 21:32pm    
Here it is short of 2 weeks later. I managed to migrate the database to MySql. But there might be some things that don't work as they should. I first tried a website that advertised to convert Sql Server database backup file to a MySql database. Well, it converted only about 10% of the information correctly. The conversion took many steps and numerous applications. But they are all free. So, I learned a lot, but I'll never use it again.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900