ChrisC
ChrisC

Reputation: 1339

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.

Upvotes: 11

Views: 8057

Answers (5)

user
user

Reputation: 1

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;

namespace DAL
{
    public class DBUtility
    {
        public static SqlConnection getconnection()
        {

           SqlConnection dbconnection = null;
            ConnectionStringSettings settings = ConfigurationManager.ConnectionStrings["constr"];
            if(settings!=null)
            {
                string str = settings.ConnectionString;
                dbconnection = new SqlConnection(str);
            }
            return dbconnection;
        }
    }




      public int createasn(IShipmentBO objBO)
      {
          int ret = 0;
          SqlConnection conn = DBUtility.getconnection();
          conn.Open();
          SqlCommand cmd = new SqlCommand();
          cmd.CommandType = CommandType.StoredProcedure;
          cmd.CommandText = "sp_CreateASN";
          cmd.Connection = conn;
          cmd.Parameters.AddWithValue("@POnumber", objBO.Ponum);
          cmd.Parameters.AddWithValue("@Unitsdelivered", objBO.Unitsdel);
          cmd.Parameters.AddWithValue("@Totalprice", objBO.Totalprice);
          cmd.Parameters.AddWithValue("@Expdeldate", objBO.Asnstatus);    
          ret = cmd.ExecuteNonQuery();
          conn.Close();

          return ret;
      }





}

Upvotes: 0

CResults
CResults

Reputation: 5105

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

Upvotes: 10

SnapJag
SnapJag

Reputation: 817

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).

Upvotes: 2

heisenberg
heisenberg

Reputation: 9759

Its a data access framework in .NET.

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

Upvotes: 1

Justin Niessner
Justin Niessner

Reputation: 245419

I added Entity Framework to the list since it's the base for a couple of your questions...

ADO.NET - The Framework for accessing data from .NET (An evolution of ActiveX Data Objects from VB)

SQLite.NET - .NET Libraries for accessing SQLite databases

ADO.NET Provider - The .NET Provider for different data sources that conform to ADO.NET standards.

ADO.NET 2.0 Provider for SQLite - .NET 2.0 Compatible ADO.NET Provider for SQLite (this is what SQLite.NET is)

Enitity Framework - A Microsoft provided Object Relational Mapper to help map Data from ADO.NET back to Objects in your application (rather than having to write all the SQL yourself).

SQLite Entity Framework - This is the ADO.NET Entity Framework for SQLite databases.

SQLite Entity Framework Provider - Another term for the ADO.NET 2.0 Provider for SQLite (ADO.NET Providers provide the base that Entity Framework builds on top of).

Upvotes: 5

Related Questions