Im trying to connect to a database, but it keeps saying "The ConnectionString property has not been initialized. " Im not sure what its refering to, my code or my connection string, Im using windows authentication in SQL Server Management. But not sure what I need to do here
Function
Dim DBConnect As SqlConnection = Connection()
DBConnect.Open()
DBConnect.Close()
Private Shared Function Connection() As SqlConnection
Dim sConnection As String = System.Configuration.ConfigurationManager.AppSettings("MyDbConn1")
Return New SqlConnection(sConnection)
End Function
A connection was successfully established with the server, but then an error occurred during the login process. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.)
Im pretty sure its the connection string but I don't now what to put in there?
Bookmarks