Re: Dot Net 2.0 or SQL Server 2005 problem?



As Cor pointed out, the "Server" name or "Data Source" in your
ConnectionString is wrong. Since the SQL Server Express is an named
instance, it should be in this format "ComputerName\InstanceName" or
".\InstanceName", this is, in youy case, "YourComputerName\SQLEXPRESS" or
".\SQLEXPRESS".

Assume the SQLExpress set up is OK, whther you can actually access the SQL
Server Express will depend on which user account you application is running
under. After installing SQL Server Express, if you did not add any SQL login
in the SQL Server Express, only local admin user account can connect to it.
SO, if your application is ASP.NET, you must add an SQL login that maps to
the user account rinning ASP.NET app (ASPNET/Network Service account, be
default).


"B. Chernick" <BChernick@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:7A9F7104-1B50-403F-A116-A36300E5D2A2@xxxxxxxxxxxxxxxx
I've done what you recommended. I first went into 'Surface Area
Configuration' and set the option to 'Using Both TCP/IP and Named Pipes'.
(I
confess that this is the first time I have been in this particular screen,
mainly because in my 20 years in programming, I have never heard the term
'Surface Area' used in conjuction with databases.)

I then rebooted just to play safe. No change. Same error message.

(Incidentally, given that all of this is happening on one isolated home
laptop, how can this be termed 'remote'?)

The Named Pipes and TCP/IP in the main configuration screen were enabled
already.

"Otis Mukinfus" wrote:

On Fri, 27 Oct 2006 18:46:01 -0700, B. Chernick
<BChernick@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

I have rather hastily installed VB 2005 Express and SQL Server 2005
Express
on my machine and I haven't much experience with either. So far as I can
remember I have mostly used default settings. SQL Exp. is set to use
Windows
validation. I already have SQL Server 2000 Developer installed so my
SQL
2005 Exp. instance is called SQLEXPRESS. I'm not sure whether I've
forgotten
how to code or I have a server problem.

As a test, I am trying a basic connect with ADO.Net and I am getting
nowhere. Here is the code.

c.ConnectionString = "Data Source=SQLEXPRESS;Initial
Catalog=AdventureWorks_Data;Trusted_Connection=True; "
c.Open()
Dim da As New SqlDataAdapter("Select * from Store", c)
da.Fill(ds, "Store")
c.Close()

It crashes on open. The error message is:
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)

Where's the best place to start looking? (Remote connections?)

Good Morning,

Go to the Start menu on your machine and follow this path Start/Microsoft
SQL
Server 2005/Configuration Tools/Surface Area Configuration

When you open Surface Area Configuration you will see form with the link
"Service Area Configuration for Services and Connections". Click the
link and
you will see a tree on the left. Follow this path:
SOMETHING_SQLEXPRESS/Database Engine/Remote Connections.

Choose the option "Local and remote Connections", then beneath that
choose the
option "Using both TCP/IP and Named Pipes".

That should fix the trouble you are having.

There is a second way to do this:

Go to the Start menu on your machine and follow this path Start/Microsoft
SQL
Server 2005/Configuration Tools/SQLServer Configuration manager

In the manager, follow the path, Network Configuration/Protocols for
SOMETHING_SQLEXPRESS.

In the listview on the right, right click the Named Pipes and TCP/IP rows
and
enable them.

Good luck with your project,

Otis Mukinfus
http://www.arltex.com
http://www.tomchilders.com



.



Relevant Pages

  • Re: MS SQL 2005 Configuration ???
    ... It sounds like you are running SQLExpress, not SQLServer. ... I don't have SQL Express, so I can't replicate what you're seeing. ... "Surface Area Configuration for Services and Connections", ... SQL Server Browser). ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: SQL Server 2005 Express Connection
    ... Some people have been having issues when trying to make remote connections ... networking protocols are disabled by default in SQL Server Express. ...
    (microsoft.public.sqlserver.connect)
  • ADO data control, proper use
    ... When opening the program there is currently five connections to SQL ... connections for a single program to have open with SQL Server. ... Is there a way to close the ado data control connection after a ...
    (microsoft.public.vb.database.ado)
  • Re: MS Access linked tables SQL Server
    ... Protocol Encryption selection so that all connections to the SQL Server are ...
    (microsoft.public.sqlserver.security)
  • Re: Publish SQL 2000 to Inet
    ... your ODBC data source/alias for SQL on the client workstation, ... go to the "Client Configuration" window and uncheck the "Dynamically ... determine port" option, then force the port number to 1433 (if that's the ... SQL Server anymore. ...
    (microsoft.public.isaserver)