Re: What's My Password?



See -->

--
____________________________________
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:%23XRJlw3MHHA.448@xxxxxxxxxxxxxxxxxxxxxxx
William,

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.

I just don't really know what that means. For testing, I will want to use
the database on my computer. After deployment, I'll want to copy the
database to the computer that hosts my Web site, and my Web site will use
the database on that same computer.

--> There are two parts to the problem. First, the DBMS engine as configured
on your system must be reproduced (reconfigured in the same way) on the
target server. Next, the database managed by SQL Server must be transported
and attached to the target DBMS engine when you're ready to deploy. That's
the nature of SQL Server and most DBMS platforms like it.


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.

The company that hosts my Web sites has the ASP.NET 2.0 frameworks
installed. My understanding is that includes a database engine. Why would
I want to install a different one?

---> No, not really. The 2.0 Framework does not include a DBMS engine of any
kind. It does include ADO.NET which is simply a set of classes used to
access any selected DBMS engine that has a .NET Provider of some kind.
You're going to have the ISP install SQL Server (of some kind) on the target
IIS server or on a server local (or at least visible) to that site. This is
not always that easy.



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.

Yeah, I actually have two of his books (Pro and Beginning). They are big
books and I really have spent very limited time with them.

I'm extremely busy with other projects and I absolutely must get up and
running with .NET and databases before I will be in a position to read all
the stuff I have. It's a very difficult position. I guess I was optimistic
that I'd be able to get to the point where I could open my database from
code without reading all these books. Perhaps I was wrong.

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.

I was just copying some of the many examples in MacDonald's Pro book.

Okay, here's what I got:

string connString = "Server=local\\SQLEXPRESS;integrated
security=SSPI;initial Catalog=BlackBeltCoder";

That gives me an error. However:

string connString = "Server=localhost\\SQLEXPRESS;integrated
security=SSPI;initial Catalog=BlackBeltCoder";

This actually works! With some additional messing around, I also found the
following works!

---> "localhost" resolves to the machinename in most cases, but I've not had
a lot of success with it in ConnectionStrings. The "\\" might be part of the
issue. Remember that when you run an ASP application, it's IIS that opens
the connection for you--not the local browser user. It uses a special
account that Rob discusses in his book. So do I, but not to as great an
extent.

string connString = "Data Source=<sysname>\\SQLExpress;Initial
Catalog=BlackBeltCoder;Integrated Security=True";

Where <sysname> is the name for my system.

So I'm not sure I followed your comment about local vs. localhost, but
only localhost works for me.

At any rate, if I can find your book, I'll take a look. If you can explain
the above, I'm all ears.

I'm now able to continue development on this project because I can
actually connect to a database. However, I still don't understand why, the
best way to create the database, or what I'll need to change when I move
it to my Web site. But one thing at a time.

Thanks.

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




.



Relevant Pages

  • Re: MS Access DAO -> ADO.NET Migration
    ... William Vaughn ... Microsoft MVP ... Hitchhiker's Guide to Visual Studio and SQL Server ... My migration app works building a SSCE database file with imported data ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Cluster will not fail over.
    ... > As far as the TCP/IP issue goes, you had to rebuild the cluster and were ... > able to restore the master database. ... > a cluster installation you'll have to revisit. ... >> This worked bringing up the sql server in minimal mode. ...
    (microsoft.public.sqlserver.clustering)
  • Re: MS Access DAO -> ADO.NET Migration
    ... For that it is much harder to handle the incremental identifier, ... database but although they have the data, they are not connected at the same ... The book was a pleasure to read after the gibberish that Microsoft 'puts ... SQL Server Management Studio is nowhere to be found on my ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Word 2003/Access2000/SQLSVR
    ... SQL server being where the data is held and this is accessed through a MS ... entire database and that may be say a record for Berkshire. ... "Peter Jamieson" wrote: ... replaced with the first record on the table in use. ...
    (microsoft.public.word.mailmerge.fields)
  • Re: MS Access DAO -> ADO.NET Migration
    ... full SQL Server and I see the logic you explained in a multi user ... allow two users to access the same database file Read/Write at any given ... The book was a pleasure to read after the gibberish that Microsoft 'puts ... Hitchhiker's Guide to Visual Studio and SQL Server ...
    (microsoft.public.dotnet.framework.adonet)