Re: Some basic questions



Jasper,

Thank you for the response.

Starting the SQL Browser service resulted in the SQLEXPRESS instance being
shown, so solves that problem.

The application connection string has 'User instance = true' so I must be
using a user instance (which I understand is a separate instance for
non-administrators).

I read in MSDN that user instances are opened in single-user mode and it is
not possible for mulitple users to connect to databases running on a user
instance.
That would explain the login problem?

What should I change to allow mulitple connections (so my application can
connect at the same time as server explorer's connection)?


"Jasper Smith" wrote:

1) A named instance called SQLEXPRESS is the default for SQL Server Express
Edition. You won't have a default instance (which is why you can't connect
to it<g>). As you have discovered the way to address this is .\SQLEXPRESS or
(local)\SQLEXPRESS or computername\SQLEXPRESS. A lot of the samples/default
web.config files etc expect this instance to exist (although it's easy
enough to adapt to a default instance). Don't know why it doesn't show up,
is the SQLBrowser service running (although that shouldn't be required
locally)

2) Not sure why you're getting this. What is your default database (set it
to master if it's not to avoid issues)? Are you using a user instance?

--
HTH,
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com


"vulcanite" <vulcanite@xxxxxxxxxxxxxxxxx> wrote in message
news:345866BC-D536-4971-B874-EC4D47D1C1A1@xxxxxxxxxxxxxxxx
I am using SQL Express and Visual Studio 2005 and have 2 questions.

Q1:
In the server explorer in VS when I try and add a connection, the 'Server
name' box lists the SQL servers according to my machine names (my
understanding is this represents the default instance of SQL on each
machine).
As I only have the SQLEXPRESS instance on my machine, I would expect the
machine name to refer to this same instance.

However, when I use the machine name as the server name I get an error
("An
error has occurred while establishing a connection to the server.
provider:
Named Pipes Provider, error 40 - Could not open a connection to SQL
Server).

But when I use .\SQLEXPRESS as the server name the connection succeeds.

I can only assume the .\SQLEXPRESS is an additional instance to the
default
machine name instance - is that correct? Seems wasteful, as I only need
one
instance.

If the above is true, why does the .\SQLEXPRESS instance not appear in the
server name box? And why does the default server not work (and how can I
get
it to work)?

I set up my SQL installation to use windows authentication.

Q2:
When I have set up a data connection in Server explorer, then my
application
(when run) is denied a connection (error: Cannot open user default
database.
Login failed. Loginf failed for user <my windows login>)

When I delete the connection in server explorer, my application runs fine.

How can I get the application to work when data connections are present in
the server explorer?

Any help appreciated.






.



Relevant Pages

  • Re: Connection issues between .Net framwok and SQl Express 2005
    ... You will no longer need the database MDF file name in the connection string. ... simply attach the ASPNETDB.mdf to SQL Server permenantly, ... as USER INSTANCE on existing SQL Server Express, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Performance of ODBC
    ... if you have a software firewall; forward 1433/1434 to your server ... I've now created my own server with SQL Server 2005 Express, ... glitch concerns the Upsizing Wizard. ... I originally set up my ODBC connection via ...
    (microsoft.public.access.adp.sqlserver)
  • SQL 2005 Express and VS .Net 2003 wizard error More options
    ... Open the server explorer panel ... Go to the Provider tab and select SQL NAtive Client (DON'T use oledb ... Go back to the Connection tab and carry on setting up the connection ... I have installed Visual Studio 2005 Professional and then Visual Studio ...
    (microsoft.public.sqlserver)
  • Re: Timeout problem with SS2K, VS03
    ... I noticed calls in sql profiler: ... This is the server side debug stored procedure. ... a timeout issue that I cannot identify the source of. ... transaction is committed and the connection is closed cleanly and all ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Cannot connect to SQL Express on 2003 Machine from XP machine
    ... listening on UDP 1434 using netstat -abn, ... And i double checked the connection string, and i did have it the right ... But I have another 2000 server that I can connect to fine, ... I am trying to connect from an XP SP2 machine remotely to a SQL Express ...
    (microsoft.public.sqlserver.connect)