PC Review


Reply
Thread Tools Rate Thread

connecting to sqlserver express

 
 
=?Utf-8?B?Qm9i?=
Guest
Posts: n/a
 
      14th Dec 2005
I installed SQLserver express as well as VS2005 Standard. I know the database
server is functioning correctly since I can manipulate it with the sqlserver
express tools. However when I try to connect to the server in VS either
programatically or through the server tools I get the same unfortunate error
message:


{"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)"}

I found a property on the server called Allow Remote Connections to the
Server, which was already checked.

Not really sure where to go from here. Any suggestions?

Thanks,

Bob


 
Reply With Quote
 
 
 
 
William \(Bill\) Vaughn
Guest
Posts: n/a
 
      14th Dec 2005
Ok, for us to help we need to know a few things:
1) Where is the SQL Server Express edition instance installed? Is it on
the same system hosting the ADO.NET program?
2) How are you trying to connect? Via the Server Explorer or the
Database Explorer?
3) Which version of VS are you using? Express or a higher version?
4) If the connection is remote, have you opened the ports on your
firewall to permit access?
5) What does your connectionstring look like?

That should be enough to get us started.

--
____________________________________
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.
__________________________________

"Bob" <(E-Mail Removed)> wrote in message
news:42B307BC-755E-43A7-ABC1-(E-Mail Removed)...
>I installed SQLserver express as well as VS2005 Standard. I know the
>database
> server is functioning correctly since I can manipulate it with the
> sqlserver
> express tools. However when I try to connect to the server in VS either
> programatically or through the server tools I get the same unfortunate
> error
> message:
>
>
> {"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)"}
>
> I found a property on the server called Allow Remote Connections to the
> Server, which was already checked.
>
> Not really sure where to go from here. Any suggestions?
>
> Thanks,
>
> Bob
>
>



 
Reply With Quote
 
Cor Ligthert [MVP]
Guest
Posts: n/a
 
      14th Dec 2005
Bob,

I had this error as well. Did you install a beta version before these final
releases.

Have than a look in this directory for Orphaned files

C:\Documents and Settings\YourUserName\Local Settings\Application
Data\Microsoft\Microsoft SQL Server Data\SQLEXPRESS

I hope this helps,

Cor


 
Reply With Quote
 
Jochen Schimmel
Guest
Posts: n/a
 
      14th Dec 2005
Hi,

I just wanted to start doing some Studio 2005 / SQL 2005 stuff and
encountered just the same problem as Bob.

My machine is brand new and has got a fresh Windows on it. I had installed
Studio 2003 and afterwards Studio 2005 with SQL 2005. When I tried to access
my local sql 2005 instance by using Server explorer -> "connect to
database" -> "Microsoft SQL Server" I get just the same error as Bob does.

I have then tried to seek for some misconfigured values in SQL Server
Configuration Manager and found that the Protocols don't have names, there
are only the icons, but no text. So I removed SQL 2005 Express from my
machine, downloaded the package from microsoft and installed it without
Studio Setup. Now I can see those strings, but the error won't vanish.
I have then enabled all protocols in Configuration manager and enabled all
stuff in Surface Area Configuration, nothing happened.

My Windows Firewall is turned on, but everything happens locally, the SQL
Express Version is 9.00.1399.06.
I have been browsing to the Docs & settings folder, there wasn't even a SQL
folder. The PC has never seen a beta.

Thanks in advance,

Jochen

"Cor Ligthert [MVP]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Bob,
>
> I had this error as well. Did you install a beta version before these
> final releases.
>
> Have than a look in this directory for Orphaned files
>
> C:\Documents and Settings\YourUserName\Local Settings\Application
> Data\Microsoft\Microsoft SQL Server Data\SQLEXPRESS
>
> I hope this helps,
>
> Cor
>



 
Reply With Quote
 
=?Utf-8?B?Qm9i?=
Guest
Posts: n/a
 
      15th Dec 2005
I have

Winows 2000 sp4.
VS 2005 Standard 8.0.50727.42
SQLServer 2005 Express 9.00.1399.06
SQl Servere Manager Studio Express CTP

Everything is on the same computer.

I've tried using code
sc = new SqlConnection("Data Source=bob;Initial
Catalog=ToDo;Integrated Security=SSPI");
sda = new SqlDataAdapter("select SqlCommandText from
sqlcommand", sc);
ds = new DataSet("SQLCOMMANDTEXT");
sda.Fill(ds, "sqlcommand");

I have also tried through the tools menu -> connect to database.
I choose SQLServer
I select my server name in drop down.
Windows authen
Nothing appears in the DB name list even after a long time searching.
If I type the name in and test I get the error message.

The Server Explorer leads to the same connection form with the same result.

I'm on the same machine so I don't think I would need to open a port. Do I?

I've tried this with my firewall on and off.

Thanks again,

Bob



"Jochen Schimmel" wrote:

> Hi,
>
> I just wanted to start doing some Studio 2005 / SQL 2005 stuff and
> encountered just the same problem as Bob.
>
> My machine is brand new and has got a fresh Windows on it. I had installed
> Studio 2003 and afterwards Studio 2005 with SQL 2005. When I tried to access
> my local sql 2005 instance by using Server explorer -> "connect to
> database" -> "Microsoft SQL Server" I get just the same error as Bob does.
>
> I have then tried to seek for some misconfigured values in SQL Server
> Configuration Manager and found that the Protocols don't have names, there
> are only the icons, but no text. So I removed SQL 2005 Express from my
> machine, downloaded the package from microsoft and installed it without
> Studio Setup. Now I can see those strings, but the error won't vanish.
> I have then enabled all protocols in Configuration manager and enabled all
> stuff in Surface Area Configuration, nothing happened.
>
> My Windows Firewall is turned on, but everything happens locally, the SQL
> Express Version is 9.00.1399.06.
> I have been browsing to the Docs & settings folder, there wasn't even a SQL
> folder. The PC has never seen a beta.
>
> Thanks in advance,
>
> Jochen
>
> "Cor Ligthert [MVP]" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Bob,
> >
> > I had this error as well. Did you install a beta version before these
> > final releases.
> >
> > Have than a look in this directory for Orphaned files
> >
> > C:\Documents and Settings\YourUserName\Local Settings\Application
> > Data\Microsoft\Microsoft SQL Server Data\SQLEXPRESS
> >
> > I hope this helps,
> >
> > Cor
> >

>
>
>

 
Reply With Quote
 
Paul Clement
Guest
Posts: n/a
 
      15th Dec 2005
On Wed, 14 Dec 2005 16:30:04 -0800, Bob <(E-Mail Removed)> wrote:

¤ I have
¤
¤ Winows 2000 sp4.
¤ VS 2005 Standard 8.0.50727.42
¤ SQLServer 2005 Express 9.00.1399.06
¤ SQl Servere Manager Studio Express CTP
¤
¤ Everything is on the same computer.
¤
¤ I've tried using code
¤ sc = new SqlConnection("Data Source=bob;Initial
¤ Catalog=ToDo;Integrated Security=SSPI");
¤ sda = new SqlDataAdapter("select SqlCommandText from
¤ sqlcommand", sc);
¤ ds = new DataSet("SQLCOMMANDTEXT");
¤ sda.Fill(ds, "sqlcommand");
¤
¤ I have also tried through the tools menu -> connect to database.
¤ I choose SQLServer
¤ I select my server name in drop down.
¤ Windows authen
¤ Nothing appears in the DB name list even after a long time searching.
¤ If I type the name in and test I get the error message.
¤
¤ The Server Explorer leads to the same connection form with the same result.
¤
¤ I'm on the same machine so I don't think I would need to open a port. Do I?
¤
¤ I've tried this with my firewall on and off.
¤

Try changing the Data Source in your connection string to (local).


Paul
~~~~
Microsoft MVP (Visual Basic)
 
Reply With Quote
 
=?Utf-8?B?Qm9i?=
Guest
Posts: n/a
 
      15th Dec 2005
I've tried that one already without success, thanks...

"Paul Clement" wrote:

> On Wed, 14 Dec 2005 16:30:04 -0800, Bob <(E-Mail Removed)> wrote:
>
> ¤ I have
> ¤
> ¤ Winows 2000 sp4.
> ¤ VS 2005 Standard 8.0.50727.42
> ¤ SQLServer 2005 Express 9.00.1399.06
> ¤ SQl Servere Manager Studio Express CTP
> ¤
> ¤ Everything is on the same computer.
> ¤
> ¤ I've tried using code
> ¤ sc = new SqlConnection("Data Source=bob;Initial
> ¤ Catalog=ToDo;Integrated Security=SSPI");
> ¤ sda = new SqlDataAdapter("select SqlCommandText from
> ¤ sqlcommand", sc);
> ¤ ds = new DataSet("SQLCOMMANDTEXT");
> ¤ sda.Fill(ds, "sqlcommand");
> ¤
> ¤ I have also tried through the tools menu -> connect to database.
> ¤ I choose SQLServer
> ¤ I select my server name in drop down.
> ¤ Windows authen
> ¤ Nothing appears in the DB name list even after a long time searching.
> ¤ If I type the name in and test I get the error message.
> ¤
> ¤ The Server Explorer leads to the same connection form with the same result.
> ¤
> ¤ I'm on the same machine so I don't think I would need to open a port. Do I?
> ¤
> ¤ I've tried this with my firewall on and off.
> ¤
>
> Try changing the Data Source in your connection string to (local).
>
>
> Paul
> ~~~~
> Microsoft MVP (Visual Basic)
>

 
Reply With Quote
 
bruce_brodinsky@glic.com
Guest
Posts: n/a
 
      15th Dec 2005

Bob wrote:
> I've tried that one already without success, thanks...
>
> "Paul Clement" wrote:
>
> > On Wed, 14 Dec 2005 16:30:04 -0800, Bob <(E-Mail Removed)>wrote:
> >
> > ¤ I have
> > ¤
> > ¤ Winows 2000 sp4.
> > ¤ VS 2005 Standard 8.0.50727.42
> > ¤ SQLServer 2005 Express 9.00.1399.06
> > ¤ SQl Servere Manager Studio Express CTP
> > ¤
> > ¤ Everything is on the same computer.
> > ¤
> > ¤ I've tried using code
> > ¤ sc = new SqlConnection("Data Source=bob;Initial
> > ¤ Catalog=ToDo;Integrated Security=SSPI");
> > ¤ sda = new SqlDataAdapter("select SqlCommandText from
> > ¤ sqlcommand", sc);
> > ¤ ds = new DataSet("SQLCOMMANDTEXT");
> > ¤ sda.Fill(ds, "sqlcommand");
> > ¤
> > ¤ I have also tried through the tools menu -> connect to database.
> > ¤ I choose SQLServer
> > ¤ I select my server name in drop down.
> > ¤ Windows authen
> > ¤ Nothing appears in the DB name list even after a long time searching.
> > ¤ If I type the name in and test I get the error message.
> > ¤
> > ¤ The Server Explorer leads to the same connection form with the sameresult.
> > ¤
> > ¤ I'm on the same machine so I don't think I would need to open a port. Do I?
> > ¤
> > ¤ I've tried this with my firewall on and off.
> > ¤
> >
> > Try changing the Data Source in your connection string to (local).
> >
> >
> > Paul
> > ~~~~
> > Microsoft MVP (Visual Basic)


Wondering if it's a permissions or security problem.... I've had
such problems with ASP.Net, Sql Server 2000, etc. I'm just a hobbyist,
usually I have to fiddle with these user/security/permissions issues
till I accidentally get them right... In fact, since it was indicated
that you could get to the database with the management tool, but not
through VS, I would say it's probably a permissions issue. Sorry I
can't help you on the details.
Bruce
> >


 
Reply With Quote
 
Jochen Schimmel
Guest
Posts: n/a
 
      15th Dec 2005
Hi Bob,

I could solve my issue... it was a total newbie bug in my case... instead of
".\SQLEXPRESS" I entered "SQLEXPRESS" in the server input field... then I
got the same error as you...

maybe you've run in the same trap as I did..

greetings,

Jochen


"Bob" <(E-Mail Removed)> wrote in message
news:3A74C41C-195A-4BA2-B4E6-(E-Mail Removed)...
>I have
>
> Winows 2000 sp4.
> VS 2005 Standard 8.0.50727.42
> SQLServer 2005 Express 9.00.1399.06
> SQl Servere Manager Studio Express CTP
>
> Everything is on the same computer.
>
> I've tried using code
> sc = new SqlConnection("Data Source=bob;Initial
> Catalog=ToDo;Integrated Security=SSPI");
> sda = new SqlDataAdapter("select SqlCommandText from
> sqlcommand", sc);
> ds = new DataSet("SQLCOMMANDTEXT");
> sda.Fill(ds, "sqlcommand");
>
> I have also tried through the tools menu -> connect to database.
> I choose SQLServer
> I select my server name in drop down.
> Windows authen
> Nothing appears in the DB name list even after a long time searching.
> If I type the name in and test I get the error message.
>
> The Server Explorer leads to the same connection form with the same
> result.
>
> I'm on the same machine so I don't think I would need to open a port. Do
> I?
>
> I've tried this with my firewall on and off.
>
> Thanks again,
>
> Bob
>
>
>
> "Jochen Schimmel" wrote:
>
>> Hi,
>>
>> I just wanted to start doing some Studio 2005 / SQL 2005 stuff and
>> encountered just the same problem as Bob.
>>
>> My machine is brand new and has got a fresh Windows on it. I had
>> installed
>> Studio 2003 and afterwards Studio 2005 with SQL 2005. When I tried to
>> access
>> my local sql 2005 instance by using Server explorer -> "connect to
>> database" -> "Microsoft SQL Server" I get just the same error as Bob
>> does.
>>
>> I have then tried to seek for some misconfigured values in SQL Server
>> Configuration Manager and found that the Protocols don't have names,
>> there
>> are only the icons, but no text. So I removed SQL 2005 Express from my
>> machine, downloaded the package from microsoft and installed it without
>> Studio Setup. Now I can see those strings, but the error won't vanish.
>> I have then enabled all protocols in Configuration manager and enabled
>> all
>> stuff in Surface Area Configuration, nothing happened.
>>
>> My Windows Firewall is turned on, but everything happens locally, the SQL
>> Express Version is 9.00.1399.06.
>> I have been browsing to the Docs & settings folder, there wasn't even a
>> SQL
>> folder. The PC has never seen a beta.
>>
>> Thanks in advance,
>>
>> Jochen
>>
>> "Cor Ligthert [MVP]" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>> > Bob,
>> >
>> > I had this error as well. Did you install a beta version before these
>> > final releases.
>> >
>> > Have than a look in this directory for Orphaned files
>> >
>> > C:\Documents and Settings\YourUserName\Local Settings\Application
>> > Data\Microsoft\Microsoft SQL Server Data\SQLEXPRESS
>> >
>> > I hope this helps,
>> >
>> > Cor
>> >

>>
>>
>>



 
Reply With Quote
 
=?Utf-8?B?Qm9i?=
Guest
Posts: n/a
 
      15th Dec 2005
I got mine working too. It was all in the name like you said.

Thanks for the fix.

You know its funny I do stuff like this at work all the time without a
problem but as soon as I start messing around with my computer at home I turn
into a newbie.

"Jochen Schimmel" wrote:

> Hi Bob,
>
> I could solve my issue... it was a total newbie bug in my case... instead of
> ".\SQLEXPRESS" I entered "SQLEXPRESS" in the server input field... then I
> got the same error as you...
>
> maybe you've run in the same trap as I did..
>
> greetings,
>
> Jochen
>
>
> "Bob" <(E-Mail Removed)> wrote in message
> news:3A74C41C-195A-4BA2-B4E6-(E-Mail Removed)...
> >I have
> >
> > Winows 2000 sp4.
> > VS 2005 Standard 8.0.50727.42
> > SQLServer 2005 Express 9.00.1399.06
> > SQl Servere Manager Studio Express CTP
> >
> > Everything is on the same computer.
> >
> > I've tried using code
> > sc = new SqlConnection("Data Source=bob;Initial
> > Catalog=ToDo;Integrated Security=SSPI");
> > sda = new SqlDataAdapter("select SqlCommandText from
> > sqlcommand", sc);
> > ds = new DataSet("SQLCOMMANDTEXT");
> > sda.Fill(ds, "sqlcommand");
> >
> > I have also tried through the tools menu -> connect to database.
> > I choose SQLServer
> > I select my server name in drop down.
> > Windows authen
> > Nothing appears in the DB name list even after a long time searching.
> > If I type the name in and test I get the error message.
> >
> > The Server Explorer leads to the same connection form with the same
> > result.
> >
> > I'm on the same machine so I don't think I would need to open a port. Do
> > I?
> >
> > I've tried this with my firewall on and off.
> >
> > Thanks again,
> >
> > Bob
> >
> >
> >
> > "Jochen Schimmel" wrote:
> >
> >> Hi,
> >>
> >> I just wanted to start doing some Studio 2005 / SQL 2005 stuff and
> >> encountered just the same problem as Bob.
> >>
> >> My machine is brand new and has got a fresh Windows on it. I had
> >> installed
> >> Studio 2003 and afterwards Studio 2005 with SQL 2005. When I tried to
> >> access
> >> my local sql 2005 instance by using Server explorer -> "connect to
> >> database" -> "Microsoft SQL Server" I get just the same error as Bob
> >> does.
> >>
> >> I have then tried to seek for some misconfigured values in SQL Server
> >> Configuration Manager and found that the Protocols don't have names,
> >> there
> >> are only the icons, but no text. So I removed SQL 2005 Express from my
> >> machine, downloaded the package from microsoft and installed it without
> >> Studio Setup. Now I can see those strings, but the error won't vanish.
> >> I have then enabled all protocols in Configuration manager and enabled
> >> all
> >> stuff in Surface Area Configuration, nothing happened.
> >>
> >> My Windows Firewall is turned on, but everything happens locally, the SQL
> >> Express Version is 9.00.1399.06.
> >> I have been browsing to the Docs & settings folder, there wasn't even a
> >> SQL
> >> folder. The PC has never seen a beta.
> >>
> >> Thanks in advance,
> >>
> >> Jochen
> >>
> >> "Cor Ligthert [MVP]" <(E-Mail Removed)> wrote in message
> >> news:(E-Mail Removed)...
> >> > Bob,
> >> >
> >> > I had this error as well. Did you install a beta version before these
> >> > final releases.
> >> >
> >> > Have than a look in this directory for Orphaned files
> >> >
> >> > C:\Documents and Settings\YourUserName\Local Settings\Application
> >> > Data\Microsoft\Microsoft SQL Server Data\SQLEXPRESS
> >> >
> >> > I hope this helps,
> >> >
> >> > Cor
> >> >
> >>
> >>
> >>

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Connecting to SqlServer 2005 Express Richard Microsoft Access 1 27th Nov 2008 09:45 AM
Connecting From PDA to SQLServer AWindisch Microsoft Dot NET Compact Framework 0 30th Mar 2006 04:36 PM
Connecting ASP.NET to SQLServer,Somebody,Please!! =?Utf-8?B?TW9oYW1tYWQtUmV6YQ==?= Microsoft ASP .NET 1 21st Apr 2004 01:11 PM
Connecting ASP.NET to SQLServer,Somebody,Please!! =?Utf-8?B?TW9oYW1tYWQtUmV6YQ==?= Microsoft ASP .NET 1 20th Apr 2004 01:39 PM
Re: Connecting to SQLServer from VB .Net Miha Markic Microsoft ADO .NET 1 8th Jan 2004 02:54 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:55 PM.