newbie questions

C

Chuck Bowling

Ok, I'm very new to ADO.NET and databases in general.

There are a couple of things I'm not clear on. First, I'm not sure exactly
what an SQL Server is. By that I mean what's the difference between an SQL
server and an Access database? Does the server only serve SQL to the Access
datasource or is it an application capable of creating and managing
datasources?

Another thing; is the Northwind data a database or a datasource - or are
they the same thing?

Thirdly, in this connection string:

SqlConnection nwindConn =
new SqlConnection("Data Source=localhost; Integrated Security=SSPI;" +
"Initial Catalog=northwind");

is Initial Catalog a database in the applications starting directory or is
it kept somewhere else?
 
J

Jani Järvinen [MVP]

Chuck,
First, I'm not sure exactly what an SQL Server is. By that
I mean what's the difference between an SQL server and an Access database?

Generally speaking a SQL server is a "big" network database that can support
multiple users and large amounts of data. SQL is the language (it has
"SELECT * FROM table" like statements) used to manipulate such databases and
query data from them.

This is in contrast to "desktop databases", that are products like Access,
Paradox, dBase, etc. These aren't that common anymore except in small
installations.

Also, "SQL Server" is a product by Microsoft. Sometimes this can be
confusing, especially when people talk about SQL servers and the Microsoft
product in the same sentence. Other big SQL databases are Oracle, DB2, and
so on.
Another thing; is the Northwind data a database or a
datasource - or are they the same thing?

Northwind is a sample SQL Server database that ships with many development
tools. So, it is a database -- but you need SQL Server to "run it", so it is
not standalone in itself.

When you are developing your own applications, you usually access the data
through a "datasource". This datasource can point to any supported database,
including the Northwind database.

So you could say that they are the same thing (depending on context), but
you can also use a datasource to point to different databases.
Thirdly, in this connection string:

SqlConnection nwindConn =
new SqlConnection("Data Source=localhost; Integrated Security=SSPI;" +
"Initial Catalog=northwind");

is Initial Catalog a database in the applications starting directory or is
it kept somewhere else?

When you use SQL Server, you "register" a database with the server, and then
it knows where the physical database file is. So when pointing to the
Northwind database from your application, you don't need to specify a file
path on the server.

In your case, the Data Source field in the connection string points to your
own computer (localhost), so actually the database would reside on your
computer. But, the file needs not be in (nor probably is) in your
application's directory.

If you want to find the physical file, search for the file "northwind.mdf".
It should be found under the Program Files folder.

Hope this helps!

--
Regards,

Mr. Jani Järvinen
C# MVP
Helsinki, Finland
(e-mail address removed)
http://www.saunalahti.fi/janij/
 
E

Earl

SQL Server is a "database management system", that is, a system for managing
databasess (emphasis on the plural). Access is a standalone database
interface. You might consider Access akin to a house and SQL Server more
akin to a city that contains houses.
 
W

William \(Bill\) Vaughn

SQL Server is just that--it's a software program (what we call a database
engine) that accepts structured query language (SQL) as input and returns
rows as output. Microsoft sells about five different versions of SQL Server
for use with tiny to large to gigantic databases. There are a dozen (or
more) other vendors that sell database engines. SQL Server handles all of
the physical IO to the physical database file(s) behind the scenes. It
protects the data, protects it from intrusion and manages its integrity (and
much more). SQL Server can support/access/connect to many hundreds of
databases. The application that connects to SQL Server is called a "client"
which can be as simple as a program that generates a string to use as a
query and submits it to the server. The SQL Server itself is called the
"server" and processes the SQL string--returning a set of rows. SQL Server
is designed to support thousands of clients.
Access is a program used to create "front-end" client database applications
(like VB). It's not a database or a database engine. Access can connect its
clients to either the (default) Joint Engine Technology (JET) database
engine or SQL Server. JET is a client-side database program that like SQL
Server does the physical IO with a database file but it runs on the client
system. JET is not particularly scalable but it can support a dozen users
that share a common database file. JET can only support one database at a
time.
Northwind is a sample database. There are versions that can be accessed by
JET or SQL Server.
In the ConnectionString you point to a where ADO should look for the data by
using the keyword "Server" or "Data Source". In the case of SQL Server, this
points to the Windows system name that's hosting SQL Server and the instance
name of the SQL Server. With JET databases, you use this to point to a
specific JET database file.
The "database" or "initial catalog" keyword in a ConnectionString tells SQL
Server (or JET) the name of the database to be accessed on the Server. Since
SQL Server can support any number of databases, you need to tell ADO which
database you're going to reference in your SQL queries.

I discuss all of this in great detail in my books.

hth

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
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.
__________________________________
 
C

Chuck Bowling

Thank you for the response. It helps a lot with the big picture. I've worked
with Access before but never with a database server.
 
C

Chuck Bowling

Thanks Earl. The fog is clearing.

Earl said:
SQL Server is a "database management system", that is, a system for
managing databasess (emphasis on the plural). Access is a standalone
database interface. You might consider Access akin to a house and SQL
Server more akin to a city that contains houses.
 
C

Chuck Bowling

Thank you Jani. I'm starting to understand how the pieces fit together now.
I appreciate the help.
 
C

Cor Ligthert

Chuck,

In addition to the others.

The big benefit from a "DataBase Server" to a "DataBase File" as I always
try to describe them, is that the DataBase Server becomes something that you
can see as a part of your Environment of Operating Systems. This means that
the user has no actual path to it. He/she gives information to the database
and retrieves information.

A DataBase file is always visible as file to the user and you have to set
paths or shares for it.

I hope this gives an additional idea.

Cor
 
B

bhawin13

Hello Chuck Bowling
There are few terms in database programming
database: it is a software which manages your data.
there are differen type of databases you can categorized by vendor or
feature.
MS Access stores everything in .mdb file
MS Sql server manages data at its own way.

connection string : It is a address of your data, and also discrive way
to access and many other things.


regards bhawin13
 
C

Chuck Bowling

Thank you Cor. I'm starting to understand. The database server is a gateway
to a collection of database files that provides connection, communication,
and security services.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top