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.

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..

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.

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."

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.