Im trying to connect a SQL Server file named mybookstore.mdf, i've created this file in a MS SQL Server 2008 Express on the server named SQLEXPRESS
when I open Visual Studio and tried to connect to it(assuming im on a project), VS cannot find my server instance when I tried to connect to it(connect to server) in the Server Explorer, i tried typing localhost\SQLEXPRESS but it throws a message that it cannot be found
i've also tried to open my database using the connect to database button on the Server Explorer but it ask me if I want to create it?
how do I connect to my sql server file or database in visual studio 2008 if i've created the server file in the SQL Express Edition 2008?
By the way, im only using 1 computer,, so im referring to the file locally.
The point here is, I want to connect to a database from an SQL Server Instance.
Can any one help me out?
and also, the services.msc shows that the instance of SQLEXPRESS is running(started)
Attach a database file on connect to a local SQL Server Express instanceProvider=SQLNCLI10;Server=.\SQLExpress;AttachDbFilename=c:\asd\qwe\mydbfile.mdf; Database=dbname; Trusted_Connection=Yes;
Attach a database file, located in the data directory, on connect to a local SQL Server Express instanceProvider=SQLNCLI10;Server=.\SQLExpress;AttachDbFilename=|DataDirectory|mydbfile.mdf; Database=dbname;Trusted_Connection=Yes;
This is copied from this page