|
-
Apr 14th, 2011, 03:37 PM
#1
Thread Starter
Lively Member
connecting to a database
Hi,
I'm having problems connecting to a database. I have sql server 2005 express installed on my PC, and i am using the following to code to connect to it.
Dim nwindConn As SqlConnection = New SqlConnection("Data Source=localhost\SQLExpress;Initial Catalog=northwnd;" & _
"Integrated Security=SSPI")
nwindConn.Open()
nwindConn.Close()
Every time i run the code it comes back with the error message " A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) "
Regards,
Kareem
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|