Databases and ADO.NET
Most of the applications today uses some sort of data storage. Perhaps the only applications I can imagine that doesn’t use some kind of storage for its data are those small and very simple applications. An application can have many kinds of data sources such as a simple text file, an XML file, and a database. Databases are typically used when storing different kinds of data such as the name, address, age, gender, and occupation of a person, music, pictures, and many more. A database is a collection of different kinds of data structured into tables consisting of fields and records. Most real world applications today uses databases to store information.
Relational databases contain data which are organized and linked to each other. Relational databases contain one or more tables interconnected to each other. Tables consists of rows and columns. In a database, the rows represent each record. For example, on a database containing records of employees, one row represents a record of an employee. The columns represent the fields or attributes. For example, an Employee has a FirstName field, a LastName field, and an Age field. You can also create relations between multiple tables. For example, an Employee table could have a field called City_ID. Then another table called Cities contains fields City_ID and the CityName. You can connect these two tables to form a relation.
Structured Query Language (SQL) is the most popular and perhaps the standard way of communicating to a database. It has commands you can use for retrieving, updating, adding, and deleting data from the database. It also allows you to create and modify databases and tables and create relationships between different tables.
Database Management Systems (DBMS) such as Microsoft SQL Server allows you to quickly access data from a database. It contains different tools such as tools for querying, creating, deleting and updating a database. Most DBMS provides you a graphical interface for creating common tasks. Other examples of DBMS are Access, Oracle, and MySQL.
ADO.NET is part of the .NET framework technology that allows you to access and modify data from different data sources. It supports many types of data sources such as Microsoft SQL Server, MySQL, Oracle, and Microsoft Access. The .NET Framework provides a number of data providers that you can use. These data providers are used to connect to a data source, executes commands, and retrieve results.The following lessons uses Windows Forms Applications as a project type for connecting to databases although you can easily incorporate what you will learn in other areas such as ASP.NET.