C# Data

Dot Net Perls

Array Collections File String Windows VB.NET Algorithm ASP.NET Cast Class Compression Convert Data Delegate Directive Enum Exception If Interface Keyword LINQ Loop Method .NET Number Regex Sort StringBuilder Struct Switch Time Value

Data: conceptual illustration

Essential complexity is that which cannot be reduced. It is found in programs that handle mountains of data. Under this crushing digital burden, highly complex databases become necessary. To use these databases with the C# language, we apply the System.Data namespace and its important types.

Representation is the essence of programming. Brooks, p. 103
SQL is the de facto standard language for querying, updating, and managing relational databases. McConnell, p. 65

DataTable

Using DataTables in the C# language can be complex and somewhat difficult. These articles, particularly the first one, help show how you can use DataTable instances in a useful way. DataTable instances represent a collection of rows and columns of data.

DataTable DataTable Compare Rows DataTable Foreach Loop DataTable Select Example Using DataTable Block Convert List to DataTable, Use DataGridView

DataRow and DataColumn. Continuing on, the System.Data namespace provides the DataRow and DataColumn types to represent rows and columns in a DataTable. DataRow instances contain the actual data; the DataColumn instances simply specify the characteristics of the columns.

DataRow DataColumn DataRow Field Extension MethodDataSet illustration

DataSet. The DataSet type can be used as a container for many DataTables. We describe specific aspects of the DataSet type in the .NET Framework and System.Data namespace.

DataSet DataSet GetXml Method DataSet GetXmlSchema Method

DataView. Another type you can use in the System.Data namespace is the DataView type. This gives you the ability to sort and filter data stored in DataTables. This article can be used as a supplement to the other data articles here.

DataView

SQL

SQL (Structured Query Language)

With SQL, you can formulate declarative queries to many different database servers. This gives you the ability to quickly manipulate and store data of various sizes. Through these tutorials, we reveal how you can use SQL in the C# programming language with SqlClient, and also specific SQL databases.

Question and answer

SqlClient. What should you do when you need to actually read in from a SQL Server database? You should add the System.Data.SqlClient namespace and then use the types written about in these articles. The result should be a fast and effective data-driven program.

SqlClient SqlCommand SqlCommandBuilder SqlConnection SqlDataAdapter SqlDataReader SqlParameter SqlClient Tutorial CodeNote (please read)

OdbcConnection. The OdbcConnection type in the C# language and .NET Framework can be used to talk to databases such as MySQL. It is very effective but may not be ideal for all databases; this article furthers the description of this type.

OdbcConnection

SQLCE. The SQLCE database made by Microsoft is also an effective embedded database platform. This article describes ways you can use it your programs using the C# programming language.

SQLCE 3.5 Database Tutorial

SQLite. One of my favorite databases is the SQLite database. It is extremely space-efficient and is also public domain. I recommend it for most embedded applications; these articles discuss specific aspects of it.

SQLite FTS3 Virtual Table SQLite Versus SQLCE Memory Usage

Summary

.NET Framework information

The System.Data namespace in the .NET Framework helps us get data out of a database and put data back into it. And while a great deal of data handling can be done with specialized types such as DataTable, less specific collections such as List or Dictionary are often necessary as well. These types are covered on this site in the Collections category.