0

I successfully create my database in entity framework code first using this string :

Data Source=DESKTOP-PL8EDEA;Initial Catalog=MyDB;Integrated Security=True;TimeOut=3600

This top connection string create database in default address of sql server databases but I want the database to be saved in my desired path I also tried this field but it was not successful

Data Source=DESKTOP-PL8EDEA;Initial Catalog=|D:\MyFolder|\MyDB;Integrated Security=True;TimeOut=3600
3

1 Answer 1

1

You can specify the path:

Server=.\SQLExpress;AttachDbFilename=C:\MyFolder\MyDataFile.mdf;Database=dbname;Trusted_Connection=Yes;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.