Re: Using SQL on Development Machine



William,

Change the "(localhost)" to "." or "(local)" to refer to the local system.

Either of these changes the error to: "Cannot open database "BlackBelt" requested by the login. The login failed. Login failed for user 'Jonathan-PC\Jonathan'."

Note that (localhost) worked on my other computer and I see localhost used in several examples. So there's yet something else that doesn't make sense. (I'm sure you discuss this in your book.) But the error seems more meaningful this time. If I right-click on the database (BlackBelt.mdf) in the Server Explorer and select the Modify Connection command, I see 'Use Windows Authentication' is selected, for which I obviously have correct authentication. And if I click 'Test Connection' from this same dialog, it reports that the connection succeeded.

This also assumes that you have rights to the default database "BlackBelt".

I created the database. I can see and open it in VS. I'm running on Vista as an administrator. So, no, I guess I don't. :-/

Is the service started? Start | SQL Server Configuration Manager to check.

Err...

SQL Server 2005 Services
- SQL Server (SQLEXPRESS) = Running
- SQL Server Browser = Stopped
SQL Server 2005 Network Configuration
- Protocols for SQLEXPRESS
- Shared Memory = Enabled
- Named Pipes = Disabled
- TCP/IP = Disabled
- VIA = Disabled
SQL Native Client Configuration
- Client Protocols
- Shared Memory = Enabled
- Named Pipes = Enabled
- TCP/IP = Enabled
- VIA = Disabled
Aliases
(Empty)

See Chapter 9 (and make sure to download the new PDF version).

PDF version of chapter 9?

Thanks.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

.



Relevant Pages

  • Cannot connect to my local SQL Server
    ... TCP/IP from my VB app. ... If I add Network Library=dbmssocn to the ... Neither can I connect to the box from other computers, though again, if I don't specify the network library, the connection is made fine. ... I checked the network settings on the sql server and they seem fine. ...
    (microsoft.public.vb.general.discussion)
  • Impossible to connect to SQL Server 2005 Express
    ... I installed SQL server 2005 SP1 on a Windows XP SP2 ... "An error has occured while establishing a connection to the server. ... TCP/IP and Named Pipes are enabled ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Problem connecting to SQL Server 2000 (only at runtime!)
    ... you are using a TCP/IP connection. ... you are sure of the library and the port number used. ... Here's my connection strings section: ... >>> When connecting to SQL Server 2005, this failure may be caused by the ...
    (microsoft.public.vsnet.general)
  • Re: Login failed for user (null)
    ... Could you elaborate on "I tried with TCP/IP and messed up something, ... If you remove TCP/IP from the SQL Server library utility (following the ... > I tried with TCP/IP and messed up something, had to install SQL server all ... > associated with a trusted SQL Server connection" error. ...
    (microsoft.public.sqlserver.clients)
  • Re: after installing XP SP2 SQL Server does not exist or access denied.
    ... There is a know issue with SP2 and SQL Server. ... to a local server (Localhost or You Machine\Instance). ... my ado.net connection on my programs do not work ... > my vb.net programs that not work anymore. ...
    (microsoft.public.dotnet.general)

Loading