Connection string error Asynchronous Processing=true

  • Thread starter Thread starter staffan
  • Start date Start date
S

staffan

Hi

Maybe I have missed something easy but I cant get Async = true fo function,
I am getting the: "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: Named Pipes Provider, error: 40 - Could not open a
connection to SQL Server) " on the "myConnection.Open()" statement. And I
have "<%@ Page Language="VB" debug="true" Culture="sv-SE" Async="True"
AsyncTimeout="10" %>" in the beginning of the file.

Please help!

Thanx!!

/Staffan

My code:
Dim myConnection As SqlConnection = New
SqlConnection("server=localhost;uid=XX;pwd=YY;database=Egna_lonelanken;Asynchronous
Processing=true")
myConnection.Open()

Dim reader As SqlDataReader

Dim command As New SqlCommand("pPercentil", myConnection)
command.CommandType = CommandType.StoredProcedure

Dim service As SqlParameter =
command.Parameters.Add("@uppsattnr", SqlDbType.Int)
service.Direction = ParameterDirection.Input
service.Value = 2380

Dim result As IAsyncResult = command.BeginExecuteReader()
reader.Read()
reader.Close()

myConnection.Close()
 
Again, perhaps my updated whitepaper on Connecting will help.
See http://betav.com/blog/billva/2007/05/managing_and_monitoring_net_co.html
or http://betav.com/blog/billva/2006/06/getting_and_staying_connected.html


--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
 
Back
Top