![]() |
Connecting to SQL Server 2005
What is the connection string I need to connect to a SQL Server 2005 Express Edition DB? (the mdf file)
I looked on ConnectionStrings.com , but wasn't able to find any. Some help would be great! I'm using VB 2005 Thanks |
Re: Connecting to SQL Server 2005
developer fusion
carlprothman Your connection string has to have this layout: :
"Data Source=<host>; Initial Catalog=<Name of Database>; Integrated Security=True"Some extra properties are as follows (these are optional): Packet Size: Number of bytes in packet use to talk to SQL server. User ID: User Name to log in. Password: Password to login. Workstation ID: Name of workstation to connect to SQL server. (Hope this helps) |
Re: Connecting to SQL Server 2005
I tried the connection string you provided, and it seems like it worked, but now I get an error on the DBConnection.Open() code line, after about 15 seconds of starting the debug process.
"Sql Exception was Unhandled" "An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)" I'm running both the Sql Server(SQLEXPRESS) and Sql Server Browser services, and enabled TCP/IP. This is the code: :
Imports System.DataThanks for the help |
| All times are GMT -5. The time now is 8:21 PM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC