943,772 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 9973
  • VB.NET RSS
You are currently viewing page 1 of this multi-page discussion thread
Apr 30th, 2007
-1

VB.Net and sql server connection

Expand Post »
I'm tyring to connect to the sql server on my lcoal machine and have this error.
"An error has occured establishing connection to the server. Failure may be caused by the fact that under the default settings SQL server does nto allow remote connections.(provider:Named Pipes Provider,error 40 - could not open a connection to sql server)"

Can someone help me fix this?

Thanks
Similar Threads
pvi
Reputation Points: 10
Solved Threads: 0
Newbie Poster
pvi is offline Offline
5 posts
since Nov 2006
Apr 30th, 2007
0

Re: VB.Net and sql server connection

can you post your code
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Sawe is offline Offline
6 posts
since Apr 2007
Apr 30th, 2007
0

Re: VB.Net and sql server connection

Is it SQL express or the full version?
If so what version is it?
Moderator
Featured Poster
Reputation Points: 1764
Solved Threads: 574
Moderator
jbennet is offline Offline
16,505 posts
since Apr 2005
Apr 30th, 2007
0

Re: VB.Net and sql server connection

Click to Expand / Collapse  Quote originally posted by Sawe ...
can you post your code
The code is as follows:

Dim strConn As String = "Integrated Security=True;" & _
"Initial Catalog=Cargo;" & _
"Data Source=localhost"
pvi
Reputation Points: 10
Solved Threads: 0
Newbie Poster
pvi is offline Offline
5 posts
since Nov 2006
Apr 30th, 2007
0

Re: VB.Net and sql server connection

Click to Expand / Collapse  Quote originally posted by jbennet ...
Is it SQL express or the full version?
If so what version is it?
It's the SqlServer express edition downlaoded from the net. Do I need to make changes to the settings in the configuration Manager?

Thanks.
pvi
Reputation Points: 10
Solved Threads: 0
Newbie Poster
pvi is offline Offline
5 posts
since Nov 2006
Apr 30th, 2007
0

Re: VB.Net and sql server connection

Try instead of localhost --> localhost\SQLEXPRESS
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Proteus is offline Offline
5 posts
since Jul 2004
Apr 30th, 2007
0

Re: VB.Net and sql server connection

yes, try that

If that doesnt work you may need to mess about with the config (sql express is set up to be secure by default, so only the local machine can connetc to it. some code doesnt like this)
Moderator
Featured Poster
Reputation Points: 1764
Solved Threads: 574
Moderator
jbennet is offline Offline
16,505 posts
since Apr 2005
Jan 14th, 2009
0

Re: VB.Net and sql server connection

do like this.

connetionString = "Data Source=ServerName;Initial Catalog=DatabaseName;User ID=UserName;Password=Password"
connection = New SqlConnection(connetionString)

jannet.
Last edited by Narue; Jan 19th, 2009 at 11:30 am. Reason: snipped link
Reputation Points: 4
Solved Threads: 0
Newbie Poster
janet_ss is offline Offline
4 posts
since Apr 2008
Jan 14th, 2009
0

Re: VB.Net and sql server connection

Erm, you know this thread is like 2 years old?
Team Colleague
Reputation Points: 361
Solved Threads: 214
Taboo Programmer
Comatose is offline Offline
2,413 posts
since Dec 2004
Jul 8th, 2010
0
Re: VB.Net and sql server connection
cn.connectionstring="Server =server name;database=dbasename;UID= id;PWD=password"
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Rashmi Awasthi is offline Offline
1 posts
since Jul 2010

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: Uploading an Image....
Next Thread in VB.NET Forum Timeline: How do I retrieve a certain column from a text file?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC