Sunday, February 19, 2012

Connection

Hi all,

I was on SQL 2000 and now changed over to SQL 2005 Ex Ed. When I run my application I get the following error Mssg @. Conn.Open
An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in system.data.dll
Additional information: System error.
Code:
Imports System.Data.SqlClient

Public Conn As SqlConnection = New SqlConnection
Dim da As New SqlDataAdapter

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Conn.ConnectionString = "Data Source=(local);" & _
"Initial Catalog=Rsch1;" & _
"Integrated Security=SSPI"
Conn.Open()

Did you added the ASPNET Account to the database security section|||Actually this is not a ASP.NET project.

Basically VB.NET is not accepting the Server name as (Local)
If I hardcode my servername as in 072-Rsch1 then it works fine.

I would like to have the server name as local as I was working with
SQL 2K.

Tnx
|||If you are using ado.net1.0 against SQL2K5, you need enable named pipe on both server and client to make (local) work. SQL2k5's local sharememory connection is not compatible with SQL2k's and ado.net1.0. If the SQL2k5 is default instaince, and you're using ado.net1.0, (local) is a known issue. You can upgraded to ado.net2.0 or use alias to work around if you don't want to change your connection string.

No comments:

Post a Comment