Archive | Data Access RSS feed for this section

Accessing Data Using System.OleDb

This simple application demonstrates several aspects of object-oriented programming in C#. It builds a simple class called "Batters" with several fields and then populates their values by retrieving data from an Access Database. In my research on how to retrieve data using System.OleDb I found that there wasn't any one help file that demonstrated how [...]

Read more

C# Database Wrapper Class

This code is a wrapper class for all database activity. The connection is basically pooledacross for the application. The end developers need not worry about the connectionsettings etc. The methods are defined to handle DML's.This is just a raw class, anyone can refine it and ifpossible notify me also… Download Wrapper.cs

Read more

Accessing Data From SQL Server

Among the many things that are changing with .NET is data access. Underthe .NET Framework, data access is handled by a set of classes calledADO.NET which are essentially an augmentation of the existing ActiveXData Objects (ADO). The ADO.NET components have been designed to factor data access fromdata manipulation. There are two central components of ADO.NET [...]

Read more

MS Access Application With C#

  What lead me to write this application is when i wanted to access theMSAccess database using c sharp I couldn't get any informationmaterial. All the material available on the net is partial to sql, andhence the purposewe will develop this application in 2 phase First we will see how tomake the database connection to [...]

Read more

Connecting Databases in C# Using ADO.Net Assemblies (Part 1)

  Database section is the most important part of any language. C# presents ADO.Net Assemblies for working with the databases. I am starting here with the easiest and lightest database, i.e, Microsoft Access. The concepts of the Connection Object and theCommand object are the same, but here is a another object likeRecordSet named as ADODataReader [...]

Read more

Introduction to DataTables: Part 2

  In the first part of this two-parts article,we have constructed and loaded a datatable. Subsequently, we retrieveddata from it. In this part of the article, we will discuss andillustrate the following: 1.Different versions of a DataRow as it goesthrough its life cycle of being added, updated, and deleted in a givenapplication. 2.How to search [...]

Read more

C# DB Connection With Beta 2

  If you are using Beta 2, then try this code to connect to your SQL server. Some words about connect string: Persist Security Info can not be omitted.DataSource is your SQL server name, not ODBC DNS name!(if you run SQL locally, putyour cursor over the icon on system toolbar , you will see "\\XXXXX", [...]

Read more

Introduction to DataTables: Part I

  The primary objective of this article is toillustrate the major characteristics of the Dot Net object namedDataTable. The DataTable has not received proper attentions in manybooks and articles. Often, the authors get involved in explaining thedetails of a more versatile and novel object named DataSet, thereby theDataTable object gets short-changed. The DataTable objects are [...]

Read more

ACCESSING DATA USING ADO.NET: PART 1 OF 3

  The ADO.NET provides disconnected access to any data source for which aManaged Provider exists. A Managed Provider is nothing but set ofobjects that talks to a data source directly. Each RDBMS vendors willprovide appropriate Managed Providers. For now, Microsoft has provided two Managed Providers: SQL Managed Provider – Provides access to SQL Server version [...]

Read more

Part 2: Insert/Search Data With SQL Server

  Previously I had written a program to select data from SQL Server.Using this program you can insert data as well as you can searchdata from SQL Server. The output will give a sample C# Form withsome menu items.Instructions: 1) At first you have to create a table 'emp_test' in SQL Server. The code will [...]

Read more