Querying a Database: Connected Approach
Querying is the process of retrieving data from a data source such as a database. We can do queries using the SELECT statement of the SQL. You will learn how to…
Connecting to a Database Through Code
The first example we encountered for connecting to databases involves Visual Studio tools that don’t require you to type any code at all. We will now begin a series of…
DataAdapter Class
A DataAdapter can be considered as a bridge between the actual data source to your application. It is commonly used together with a DataSet. Using DataAdapter and DataSet is the disconnected way of retrieving data from the…
DataReader Class
A DataReader object allows forward-only, read-only access to a database. Different properties and strategies for the Command classes are saved for later exercises. Each provider has its own version of DataReader which inherits the ;base class. Provider…
Command Class
Each data provider has their Command class which is used to execute SQL commands or stored procedures to the database. Each Command class inherits from the ;base class. The following are the different…
Connection Class
Each data provider in contains a Connection class that inherits from the ; class. The DbConnection serves as the base class for all the Connection classes of different data providers. The following are the connection categories for…
Data Providers
A data provider is a set of classes the manages and handles the connection to a data source such as SQL Server. The .NET Framework provides you with different data…
Connection Strings
A connection string may be a series of name/value pairs separated by punctuation that indicate the settings for connecting to a database. Such settings embody the situation of the database,…
Connecting to a Database with Visual Studio Tools
Before we delve into the data-driven world of , let’s first take a look at some tools available in the Visual Studio products. The following example shows you one way…
Installing SQL Server 2008 Express
We will be using Microsoft SQL Server 2008 Express as our main data source. SQL Server is already installed if you have Visual C# Express or Visual Studio 2010, provided…