VB.Net and sql server connection

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Nov 2006
Posts: 5
Reputation: pvi is an unknown quantity at this point 
Solved Threads: 0
pvi pvi is offline Offline
Newbie Poster

VB.Net and sql server connection

 
0
  #1
Apr 30th, 2007
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
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 6
Reputation: Sawe is an unknown quantity at this point 
Solved Threads: 0
Sawe Sawe is offline Offline
Newbie Poster

Re: VB.Net and sql server connection

 
0
  #2
Apr 30th, 2007
can you post your code
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 16,146
Reputation: jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all 
Solved Threads: 530
Moderator
Featured Poster
jbennet's Avatar
jbennet jbennet is offline Offline
Moderator

Re: VB.Net and sql server connection

 
0
  #3
Apr 30th, 2007
Is it SQL express or the full version?
If so what version is it?
If i am helpful, please give me reputation points.
Reply With Quote Quick reply to this message  
Join Date: Nov 2006
Posts: 5
Reputation: pvi is an unknown quantity at this point 
Solved Threads: 0
pvi pvi is offline Offline
Newbie Poster

Re: VB.Net and sql server connection

 
0
  #4
Apr 30th, 2007
Originally Posted by Sawe View Post
can you post your code
The code is as follows:

Dim strConn As String = "Integrated Security=True;" & _
"Initial Catalog=Cargo;" & _
"Data Source=localhost"
Reply With Quote Quick reply to this message  
Join Date: Nov 2006
Posts: 5
Reputation: pvi is an unknown quantity at this point 
Solved Threads: 0
pvi pvi is offline Offline
Newbie Poster

Re: VB.Net and sql server connection

 
0
  #5
Apr 30th, 2007
Originally Posted by jbennet View Post
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.
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 5
Reputation: Proteus is an unknown quantity at this point 
Solved Threads: 0
Proteus Proteus is offline Offline
Newbie Poster

Re: VB.Net and sql server connection

 
0
  #6
Apr 30th, 2007
Try instead of localhost --> localhost\SQLEXPRESS
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 16,146
Reputation: jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all 
Solved Threads: 530
Moderator
Featured Poster
jbennet's Avatar
jbennet jbennet is offline Offline
Moderator

Re: VB.Net and sql server connection

 
0
  #7
Apr 30th, 2007
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)
If i am helpful, please give me reputation points.
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 4
Reputation: janet_ss has a little shameless behaviour in the past 
Solved Threads: 0
janet_ss janet_ss is offline Offline
Newbie Poster

Re: VB.Net and sql server connection

 
0
  #8
Jan 14th, 2009
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
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: VB.Net and sql server connection

 
0
  #9
Jan 14th, 2009
Erm, you know this thread is like 2 years old?
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC