tags:

views:

159

answers:

4
+3  Q: 

What is ADO.NET?

I've written a few Access db's and used some light VBA, and had an OO class. Now I'm undertaking to write a C# db app. I've got VS and System.Data.SQLite installed and connected, and have entered my tables and columns, but that's where I'm stuck.

I'm trying to find what info and tutorials I need to look for, but there are a lot of terms I don't understand and I don't know if or exactly how they apply to my project.

I've read definitions for these terms (Wikipedia and elsewhere), but the definitions don't make sense to me because I don't know what they are or how they fit together or which ones are optional or not optional for my project.

Some of the terms on the System.Data.SQLite website (I wanted to use System.Data.SQLite for my db).

I figured my first step in my project would be to get the db and queries set up and tested. Please tell me if there are other pieces of this part of the puzzle I will need to know about, too. If I can figure out what's what, I can start looking for the tutorials I need. (btw, I know I don't want to use an ORM because my app is so simple, and because I want to keep from biting off too much too soon.)

Thank you very much.

SQLite.NET

Framework

ADO.NET

ADO.NET provider

ADO.NET 2.0 Provider for SQLite

Update: Removed "Entity Framework" terms because apparently they are ORM's, which I won't be using.

Also, please talk to me as if I know nothing except what my limited experience (above) covers (unfortunately that's the case since I've gotten so confused while trying to research this stuff, all the terms have overwhelmed me into overload-paralysis.) Thank you.

+2  A: 
Justin Niessner
Thanks Justin. Another answerer said that ADO.NET is the libraries that are used to communicate with a db, but you have that ADO.NET is a "framework". Is that the same thing? Also, you have that SQLite.NET is libraries. Does having SQLite.NET libraries mean I won't use ADO.NET libraries?
ChrisC
ADO.NET is a Framework...part of which are the ADO.NET Providers which provide the actual interface to the databases (SQL Server, Oracle, SQLite, etc.). SQLite.NET is the ADO.NET Provider for SQLite databases (so when you're using SQLite, you're using ADO.NET).
Justin Niessner
A: 

Its a data access framework in .NET.

DataTables and DataAdapters are probably good places to start if you're totally lost.

kekekela
+5  A: 

Loosely, in easy speak

ADO.NET is a library of commands and objects that allow your application to talk to a database. If you have used ADODB in VB6/C++ then ADO.NET is the .net (vb.net/C#) equivalent. ADO.NET provides you with objects such as a connection object, dataset and datareader objects.

ADO.NET provider Think of a provider like a graphics or device driver. Each time you put a different graphics card inside your computer you need to have a new graphics driver to get your graphics card to work at its best. The same is true for ADO.NET, for each different type of database you connect to (e.g Microsoft Access, Microsoft SQL Server, MySQL, Sybase, Oracle etc.) you will need a different ADODB.Net provider. A handful come as standard (for example, the provider for SQL Server)

SQLite.NET Is a database server or RDBMS - think of it as a lightweight competitor to SQL Server or MySQL.

ADO.NET 2.0 Provider for SQLite Combine the last two answers!

SQLite Entity Framework and SQLite Entity Framework provider This is a whole different subject completely. Look up Object Relational Mapping

CResults
Thanks CResults. Do the ADO.NET libraries come standard in VS/C#? (I am not familiar with ADODB.) If ADO.NET is the libraries, then what does the ADO.NET provider do?
ChrisC
Yes, it does come with VS/C# as it is part of the dot net framework and lives under the System.Data namespace. See my edit to ADO.NET provider above.
CResults
Gotcha, I think. So since I'm using SQLite as my db, and have installed System.Data.SQLite, and have created a db and keyed my tables and columns while in VS, does that mean that System.Data.SQLite is my provider and I'm covered regarding that point?
ChrisC
Yep, sounds good to me! Your learning curve should next move on to include connections, commands, dataadapters, datareaders, datatables and datasets. There is tons of stuff out there on the internet about these. Make sure you get a good understanding of these and you'll be well on your way. Leave Entity Framework (which is an ORM) until another day
CResults
ADO.NET is a framework that contains multiple providers. A provider is a collection of classes that allow you to talk to a specific type of database.
Greg
+1  A: 

There are large amounts of books written to cover this topic ... so this won't be an exhaustive answer, but this will give you the necessary information needed to begin. And it is very much simplified.

ADO.NET is a framework that allows you to manage, in memory, the data retrieved from the database (permanent storage) and connect it to display objects (textboxes, etc). Access databases have all the "layers" contained in it (the form, query, tables) and you don't have to mess too much with the activities to retrieve the information and display them. However, now that you have graduated to a Visual Studio project, you need to manage each of the layers.

  1. Create your database
  2. Populate it with data
  3. Create stored procedures (in the database), or write SQL statements (in the application) to retrieve, insert, delete, update data by using Command objects
  4. Install a data provider (for SQLite, MSSQL, MySQL, Oracle)
  5. Build the User Interface
  6. In the interface Events, create an instance of the a ADO.NET provider Connection, Adapter, and Command/Table objects.
  7. Using the Command objects (and DataReaders), retrieve data using SELECT statements; and subsequently using Update, Insert, Delete statements to put data back.
  8. Update the interface text boxes by referencing the Reader fields.

In parts 3-7 you will do most of your work (the stuff you are asking about); you will be using ADO.net to connect to the data source, using a data provider (SQLite) + connection string (with Catalog name, Username, Password, Connection type). Then, use the objects, like Connections (to connect), Adapters (to build holding areas), and DataTables (tables in memory) to do the data retrieval and actions that get and push the data to/from the database (static permanent data).

SnapJag
Q on step 1: part of what I'm trying to figure out is how to finish setting up my db (tabkes and colums are done). Things like relationships, etc. Q on step 3: how do I decide if queries should be in the db or in the app? Q on step 4: did I not already install the provider (because I'm setting up the db from with VS)?
ChrisC