How to connect Microsoft Access Database to Windows Form c#

August 20, 2015 , 0 Comments

In this article we will learn how to connect access database to windows form application. Get the MS Access data in windows form application. Access is a database system or you can its a tool of MS-Office. Through this we can store data permanently in it. If you want to store data in it by the help of windows application then you should connect it with the application.

If you want to connect the database with the windows form application then you must to install the MS- Access in the computer. Also must to install connection drivers properly. Now, follow the instruction to connect ms-access database to windows form c#.

  1. First to prepare a database file in MS-Access.
  2. Add a windows form project Using Visual Studio 2013 or earlier.
  3. Add a Method just after Initializing Component. Like 

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.OleDb;
using System.Configuration;

namespace ConnectAccessDatabase
    public partial class Form1 : Form
        public Form1()

        private void loadgrid()
            OleDbConnection con = new OleDbConnection();
            con.ConnectionString = ConfigurationManager.ConnectionStrings["Connection"].ToString();
            MessageBox.Show("Connection Sucess");


Jacob Lefore

Some say he’s half man half fish, others say he’s more of a seventy/thirty split. Either way he’s a fishy bastard. Google