I have SQL Server 2008 installed with Visual Studio 2010, I have downloaded a project which has database files created in Visual Studio project itself, now I want to connect to that database.
I tried changing the connection string but unable to connect to the database.
Can anyone tell me how to connect to the database, I have SQL Server 2008 (10.0.1600.22) installed on my machine
Updated connection string:
Here is the connection string I am using
Data Source=SQLEXPRESS\;Initial Catalog=INVENTORY;uid=xxx;pwd=xxx
where xxx\xxx
is my machine and my installed SQL Server instance name respectively.
Best Answer
Are you using C#?
try this:
set a breakpoint at con.Open(), if it succeeds and passed this line, that means you have successfully connected to the database.
After that, you may want to execute a SQL Command try this: