0

Hello
How to place a MYSQL database in my ASP.NET site?
In what format I produces the file for my APP_DATA database folder to place it.
How to build CONNECTION STRING to database located in APP_DATA
I created a site communicates with a LOCALHOST database
Now I want to import it into my website folder APP_DATA
Please help.

Edited by anetta: n/a

2
Contributors
3
Replies
5
Views
6 Years
Discussion Span
Last Post by anetta
0

Hello
How to place a MYSQL database in my ASP.NET site?
In what format I produces the file for my APP_DATA database folder to place it.
How to build CONNECTION STRING to database located in APP_DATA
I created a site communicates with a LOCALHOST database
Now I want to import it into my website folder APP_DATA
Please help.

Hi Anetta,

I tried out with MS SQL Server. Hope you can try to create an MDF file and import the file to mysql using sqlyog tool and create equivalent file related to mdf in sql server. Copy and paste the mdf file to the App_Data folder of the solution path. Now go to App_Data in your solution and right click on that and select Add->Existing Items->Add the pasted mdf file to it. Now you can give the connection string in your web.config to connect and fetch data from the mdf file.

<add name="NameToReferInCodeFromConfig" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\FileName.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient" />

Note: you need to update the mdf file when ever you have new data into the original DB.

Another way is by Adding New Item on right clicking the App_Data folder in the solution and add new .mdf file and need to create DB with new tables and all others... It seems to be vague..

0

My goal is to work with MYSQL databases , not MS SQL .
They have different providers, as that, say to MS SQL and MS ACCESS - MDF and MDB database files, correspondently.
So MYSQL data file must be with an appropriate extension, maybe FRM.
Thanks again.

Edited by anetta: n/a

0

Solved.
I find the answer hear:

by ronverdonk
"
Basically, in order to upload a database to the server, you also must have a MySQL installed at that server. How would you otherwise import the uploaded data?

Uploading itself can be done very quickly, provided you have MySQL installed at your server. At your PC you can export (phpMyAdmin is the easiest way) each database to an SQL format file. Upload that SQL file and import it into the server's MySQL."

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.