Connection string error Asynchronous Processing=true

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()
 
W

William \(Bill\) Vaughn

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top