Requirements to Run ADO.NET Application

  • Thread starter Thread starter Jonathan Wood
  • Start date Start date
J

Jonathan Wood

I'm grappling with understanding some ADO.NET issues. I'd appreciate any
help.

If I write a .NET Windows application that uses ADO.NET, what needs to be
distributed with my application in order for it to run for Customers using
Windows Vista?

I understood ADO.NET is included with the .NET frameworks. I also understood
that Microsoft Mail uses a .NET database to index message files. This had me
thinking that Vista systems had everything needed to run a Windows
application that uses ADO.NET.

But now I'm not so sure. Is it possible to write a .NET ADO.NET application
without a database server such as SQL Server? If so, how? If not, then how
do applications like Microsoft Mail work without SQL Server installed.

Jonathan
 
What is Microsoft Mail? I know something from MS, such as Outlook, Outlook
Express, Windows Mail, which is Outlook Expresss replacement on Vista.
Haven't heard "MS Mail".

ADO.NET application only requires .NET framework. Of couse, if your app need
to access data stored in particular data source, such as SQL Server, Access
Jet db..., your application has to know where the data source is and have
permission to access it. It could be on the same computer, or on the
network/the Internet somewhere.

So, yes, it more than possible to write app using ADO.NET without SQL Server
(or other database/database server, for this matter) installed on the same
computer where your app sits. If your app does not use anything not included
in .NET, you do not need distribute anything, as long as your user has .NET
framework installed

If the "MS Mail", as you mention and believe, requires SQL Server, then you
have to get it installed. But this has nothing to do with your ADO.NET
application, unless your application need to work with it.

HTH
 
Norman,
What is Microsoft Mail? I know something from MS, such as Outlook, Outlook
Express, Windows Mail, which is Outlook Expresss replacement on Vista.
Haven't heard "MS Mail".

Yeah, Windows Mail.
So, yes, it more than possible to write app using ADO.NET without SQL
Server (or other database/database server, for this matter) installed on
the same computer where your app sits. If your app does not use anything
not included in .NET, you do not need distribute anything, as long as your
user has .NET framework installed

I'm just trying to figure out what type of database access doesn't require
anything beyond ADO.NET. Every time I've connected to a database so far, it
included a connection string that normally involves some type of database
server. Can you tell me how to open a database in a way that does not
require anything beyond ADO.NET?
If the "MS Mail", as you mention and believe, requires SQL Server, then
you have to get it installed. But this has nothing to do with your ADO.NET
application, unless your application need to work with it.

I have no reason to believe (and have not stated) that Windows Mail requires
SQL Server, only that it uses the database included with the .NET framework.
I'm just wondering what that database access looks like without involving
anything other than a database file.

Thanks.

Jonathan
 
See >>>

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant, Dad, Grandpa
Microsoft MVP
INETA Speaker
www.betav.com
www.betav.com/blog/billva
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 said:
I'm grappling with understanding some ADO.NET issues. I'd appreciate any
help.

If I write a .NET Windows application that uses ADO.NET, what needs to be
distributed with my application in order for it to run for Customers using
Windows Vista?

Well, when you create an application, you bind to objects exposed by one of
the .NET Frameworks. There are at least 5 at this time: 1, 1.1, 2.0, 3.0 and
3.5. This means the targeted version of the framework must be installed on
the system--you cannot take this for granted.
 
William,

So, if I want to access a database in a .NET application, are you saying I
must either A) make certain the computer my application is running on has
server software such as MS SQL Server installed, or B) I must bypass
ADO.NET?

There's no way ADO.NET can simply open and work with an MDF file directly
without database server software?

Jonathan
 
Jonathan,

If you want to write a program that works with SQL Server data then you must
go through SQL Server.

There is no way to access SQL Server data with ADO.Net (or any other
technology) without SQL Server.

Kerry Moorman
 
Kerry Moorman said:
Jonathan,

If you want to write a program that works with SQL Server data then you
must
go through SQL Server.

There is no way to access SQL Server data with ADO.Net (or any other
technology) without SQL Server.

You could write and read directly from its files ;-).
Just kidding
 
What I'm asking is if it's possible to write an ADO.NET Windows application
that doesn't require or use any type of server software. If I can just
access the database file directly using the ADO.NET built in to the .NET
framework.

If I'm still being unclear, for the purposes of this question, I do *NOT*
want the program to work with SQL Server.

Jonathan
 
Jonathan,

You could work with a non-server DBMS such as Access through ADO.Net without
needing Access installed.

But for any of the server-type DBMSs like SQL Server, Oracle, DB2, etc., you
need the DBMS installed and then your ADO.Net code "talks to" the server DBMS.

Kerry Moorman
 
Kerry,
You could work with a non-server DBMS such as Access through ADO.Net
without
needing Access installed.

Really, I can use an Access database without Access? Where would I find out
about this? Is a connection string still involved? What does it look like?
That's what I'm trying to find out.
But for any of the server-type DBMSs like SQL Server, Oracle, DB2, etc.,
you
need the DBMS installed and then your ADO.Net code "talks to" the server
DBMS.

Yes, I understand. If I want to access some sort of server software then
that software must be installed. The only purpose of this thread is to
explorer what options I have that don't involve these.

Jonathan
 
Jonathan,

Here is an example of a connection string to connect to an Access mdb
database file named "myDB.mdb":

Dim cn As New OleDbConnection(("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=myDB.mdb;"))

Kerry Moorman
 
If that works with no additional software other than the .NET framework,
that is exactly what I'm looking for.

I'll check it out. Thanks.

Jonathan
 
Jonathan,

Take note that JET driver (Access) is installed with MDAC (which is
installed along .net, too).
However, JET driver was pulled out of MDAC for a while (now it is back in)
and thus it isn't guaranteed to be available. I don't know which versions
are missing the JET out of my head.
 
Is it assumed I know what MDAC is? So, you're saying the OleDbConnection
string posted below may not work on all computers with the .NET framework
installed?

Jonathan

Miha Markic said:
Jonathan,

Take note that JET driver (Access) is installed with MDAC (which is
installed along .net, too).
However, JET driver was pulled out of MDAC for a while (now it is back in)
and thus it isn't guaranteed to be available. I don't know which versions
are missing the JET out of my head.
--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

Jonathan Wood said:
If that works with no additional software other than the .NET framework,
that is exactly what I'm looking for.

I'll check it out. Thanks.

Jonathan
 
Jonathan Wood said:
Is it assumed I know what MDAC is? So, you're saying the OleDbConnection
string posted below may not work on all computers with the .NET framework
installed?

Yes, it depends on the MDAC version installed (somebody might install a
different version of MDAC regardless of version installed with .net).
BTW here you'll find connection string definitions:
www.connectionstrings.com
 
Do not beconfused with application (you developed), application development
framework (.NET Framework) and various type s of data source, be it
server-base database system (MySQL, SQL Server, Oracle), or file base
database system (Jet database, *.mdb/*.mde, or you can loosely call it
Access database), or even a flat text file.

Server based database itself is complicated enough to learn and use. Most
programming starter starts with Access database (Jet database), since it is
file based. To access jet database, you do not need Access installed, you
only need Jet engine available, which comes in all Windows OS, at least
since Win95 (you may need to download latest Jet SP (SP8) if you use older
Windows OS, though).

When you do ADO.NET app, you could then use a *.mdb file as data source
(using OleDb namespace in ADO.NET), you could even use Excel sheet (*.xls)
or comma delimited flat text as data source. In this case, yes you do not
need anything else installed besides .NET.

However, if you need truy database system, then you have make your choice of
database system products, which most likely is not a part of either Windows
or .NET, and most likely, it cost money to buy and cost time to learn and
use. In this case, you app might be a very small part of the entire system
and cost the least to build.

These days, server based database find their places in most software
development, while file based database is mostly used on desktop app for
single user settings (if the db is a decent product, such as Jet/Access
database, it may still be used in multiple users/LAN settings, but certainly
not good choice for web applications). If you are really geared to
programming, learning/using database server is certainly a basic. In MS
platform, SQL Server is the mostly used product, that is why all
..NET/ADO.NET example use it and it comes with VS (but it is NOT PART of .NET
framework).


Jonathan Wood said:
Is it assumed I know what MDAC is? So, you're saying the OleDbConnection
string posted below may not work on all computers with the .NET framework
installed?

Jonathan

Miha Markic said:
Jonathan,

Take note that JET driver (Access) is installed with MDAC (which is
installed along .net, too).
However, JET driver was pulled out of MDAC for a while (now it is back
in) and thus it isn't guaranteed to be available. I don't know which
versions are missing the JET out of my head.
--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

Jonathan Wood said:
If that works with no additional software other than the .NET framework,
that is exactly what I'm looking for.

I'll check it out. Thanks.

Jonathan

message Jonathan,

Here is an example of a connection string to connect to an Access mdb
database file named "myDB.mdb":

Dim cn As New OleDbConnection(("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=myDB.mdb;"))

Kerry Moorman


:


Really, I can use an Access database without Access? Where would I
find out
about this? Is a connection string still involved? What does it look
like?
That's what I'm trying to find out.


Jonathan
 
Miha,
Yes, it depends on the MDAC version installed (somebody might install a
different version of MDAC regardless of version installed with .net).
BTW here you'll find connection string definitions:
www.connectionstrings.com

I wasn't sure what I was looking for at that link.

The bottom line for me is that I want my application to install painlessly
on customers' computers. When writing a Windows .NET application, I can
write my own code to save data to disk, or I can use the .NET database
stuff. If the database stuff either requires additional installations or is
not guaranteed to work on all computers with .NET, then I'll avoid it.

It sounds like you're saying it may not work on all computers with .NET, so
I should avoid the database routines for my desktop applications.

Thanks.

Jonathan
 
Norman,
Do not beconfused with application (you developed), application
development framework (.NET Framework) and various type s of data source,
be it server-base database system (MySQL, SQL Server, Oracle), or file
base database system (Jet database, *.mdb/*.mde, or you can loosely call
it Access database), or even a flat text file.

I didn't think I was confused on that issue.
When you do ADO.NET app, you could then use a *.mdb file as data source
(using OleDb namespace in ADO.NET), you could even use Excel sheet (*.xls)
or comma delimited flat text as data source. In this case, yes you do not
need anything else installed besides .NET.

Well, that's the exact info I'm after. However, it's a little confusing
because of Miha's comments that the "JET driver is installed with MDAC" and
that driver was "pulled out of MDAC for a while." This seemed to suggest to
me that, on some systems with .NET, additional drivers may be required to
use MDB files.
However, if you need truy database system, then you have make your choice
of database system products, which most likely is not a part of either
Windows or .NET, and most likely, it cost money to buy and cost time to
learn and use. In this case, you app might be a very small part of the
entire system and cost the least to build.

That's the approach I'll take for Web development. Not for desktop
applications.

Thanks.

Jonathan
 
Jonathan Wood said:
Miha,


I wasn't sure what I was looking for at that link.

The bottom line for me is that I want my application to install painlessly
on customers' computers. When writing a Windows .NET application, I can
write my own code to save data to disk, or I can use the .NET database
stuff. If the database stuff either requires additional installations or
is not guaranteed to work on all computers with .NET, then I'll avoid it.

It sounds like you're saying it may not work on all computers with .NET,
so I should avoid the database routines for my desktop applications.

You have to understand that ado.net is *not a database engine*. It is an
abstraction layer *over database stuff*. No database engine is part of .net.
It happens that jet is a part of MDAC and MDAC is installed with .net.
But let's get back to your problem. You want a database without need to
worry.
I would recomend SQL Server 2005 CE.
http://www.microsoft.com/sql/editions/compact/default.mspx
It is a subset of real SQL Server, it is free and it is deployed by simpy
including an assembly or two with your app (I haven't worked with it yet) -
no deployment hassles at all!
 
Back
Top