Re: What's My Password?
- From: "William \(Bill\) Vaughn" <billvaRemoveThis@xxxxxxxxxx>
- Date: Mon, 8 Jan 2007 13:40:29 -0800
Ok, then you have other issues to consider.
1) When using any instance of SQL Server you can access it via the network
(via netlibs like TCP/IP or named pipes) and a NIC or you can access it via
the (default) Shared Memory provider. This second option does not require
going through the NIC. This is the default for SQL Express as it's initially
intended to be accessed from the client system.
2) Yes, you can access a SQL Express instance from a hosted ISP, but this
assumes the ISP will let you install it. Some won't--thus the need for
alternative DBMS engines that they don't have to manage. Yes, management is
a serious issue. It includes backups, log truncation, security and more.
3) The MacDonald book is a good one. My daughter Fred edited it (or an
earlier version) and I use it as my ASP.NET reference. It is a must-read for
ASP developers. My book is predominantly for Visual Studio/SQL Server
developers as it discusses issues that all architectures are likely to see
but it only uses Windows Forms examples. That's because too many developers
think they need ASP when they don't--not really and the concepts apply
across the board.
4) When you build a ConnectionString, it's not enough to simply reference
the local system, you have to reference the specific named instance of SQL
Server. That's because there could be a dozen instances hosted on the
system. A correct connection string (in your case) could look like this:
"Server=local\SQLEXPRESS;integrated security=SSPI;initial
Catalog=BlackBeltCoder"
Note that I used "local", not "localhost" which is used in a URL. You can
also use "." as in ".\SQLEXPRESS" as well to refer to the local system
(whatever its name is). Don't be confused by the (unfortunate) exception
message you get back from ADO.NET. It has lead many developers astray.
hth
--
____________________________________
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.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------
"Jonathan Wood" <jwood@xxxxxxxxxxxxxxxx> wrote in message
news:OOkeiN2MHHA.4992@xxxxxxxxxxxxxxxxxxxxxxx
William,
When you install any version of Visual Studio (even the Express SKU), it
installs SQL Server Express Edition (quietly). There's no reason you
should have known that.
Yes, thank you!
To determine if you have SQL Server Express installed, use the Server
Explorer in Visual Studio and click on Servers | YourSystem | Services
and scroll down to see if "SQL Server (SQLEXPRESS)" is listed. If it's
there, you have an instance of SQL Server (named "SQLEXPRESS") installed
and (possibly) running on your system. This assumes you aren't running
the Express SKU of Visual Studio as this exposes a "database" explorer
instead with far more limited functionality.
Yes, there is an entry named "SQL Server (SQLEXPRESS)".
Suddenly, I feel I'm actually moving forward. However, there are two
issues in my mind. 1) It appears I have SQL Server Express, but I'm not as
sure that's the version I want to use. And 2) I will eventually move this
to my Web server (currently hosted by GoDaddy.com) and assume I will need
to use whatever they have.
When connecting to any instance of SQL Server, you have to establish who
you are and which database on the server (it can support virtually any
number of databases) you want to use. You identify yourself with username
and password credentials. These can either be supplied by Windows
authentication (as when you logged on to your system or on to a domain)
or by SQL Server authentication. By default, only Windows authentication
is enabled (on all SKUs of SQL Server). This means that SQL Server must
have a Login account setup to permit access to the server. By default,
SQL Server permits members of the Administrators group to be granted
access to the server. If you don't have a Username and Password in your
ConnectionString, you must have "Trusted Connection=Yes" or "Integrated
Security=SSPI" to indicate that SQL Server is to use the current user's
Windows authentication credentials. However, when creating an
application, you can't assume that the end-user will have those rights.
To reiterate, this is a Web site I'm developing (although I do plan to
develop some desktop applications in the future that will use a database).
Here are the connection strings I've tried to far:
1. "Data Source=localhost;Initial Catalog=BlackBeltCoder;Integrated
Security=True"
2. "Data Source=localhost;Initial Catalog=BlackBeltCoder;Integrated
Security=SSPI"
3. "Data Source=localhost;Initial Catalog=BlackBeltCoder;user
id=sa;password=opensesame"
In all cases, the following code fails:
SqlConnection conn = new SqlConnection(connString);
conn.Open();
I just get a message about not being configured for remote connections,
which I don't understand since (at least, so far) it would seem to be a
local connection.
I discuss how to configure the server and all of this in far more detail
in my latest book--See Chapter 9.
Well, perhaps I should look out for that then.
Thanks.
--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com
.
- Follow-Ups:
- Re: What's My Password?
- From: Jonathan Wood
- Re: What's My Password?
- References:
- What's My Password?
- From: Jonathan Wood
- Re: What's My Password?
- From: William \(Bill\) Vaughn
- Re: What's My Password?
- From: Jonathan Wood
- Re: What's My Password?
- From: William \(Bill\) Vaughn
- Re: What's My Password?
- From: Jonathan Wood
- What's My Password?
- Prev by Date: Fresh installation
- Next by Date: Re: Fresh installation
- Previous by thread: Re: What's My Password?
- Next by thread: Re: What's My Password?
- Index(es):
Relevant Pages
|