C Sharp And Ms Access Database Tutorial 2 How To Create Ms Access Database Table In C Sharp

C# And Ms Access Database Tutorial #2 – How To Create Ms Access Database Table In C#

How To Create Ms Access Database Table In C#

Microsoft Access Database can have multiple tables. So this tutorial shows how to create a new access table. This is all about adding a new table to already existing database.

Table Is a Structure Composed of rows and column. Each column belongs to a particular datatype. So each column should hold a specific type of data like (Images, Text). But not both. You cannot insert an image in text column. Whenever you add a new entry, its added to a new table row. Mostly the first column in table contains ID, Which is unique. The ID is mostly considered as the primary key of the table. Id Must be unique. Primary key cannot hold duplicate values. Values of this nature are auto incremented whenever you add a new row to the table. If you want to retrieve specific row data from the table you can use ID (primary key) since its unique in all rows.

Create A Table And Add Fields

Open The Database From Storage Location.

How To Create Ms Access Table And Add Fields In C Sharp - Documents Folder
How To Create Ms Access Table And Add Fields In C Sharp – Documents Folder

To create a new table in existing Microsoft access database;
Go to create tab.

How To Create Ms Access Table And Add Fields In C Sharp - Create Tab - Select Table
How To Create Ms Access Table And Add Fields In C Sharp – Create Tab – Select Table


Double Click on table.
A new table will be created with auto generated name.

How To Create Ms Access Table And Add Fields In C Sharp - New Table Created
How To Create Ms Access Table And Add Fields In C Sharp – New Table Created


Right click on table name from the left pane and choose design view. (Or select a table and go to view and choose design view from Dropdown menu).

How To Create Ms Access Table And Add Fields In C Sharp - Select Design View
How To Create Ms Access Table And Add Fields In C Sharp – Select Design View


You’ll be prompted to enter table name. Enter the desired name and click OK.

How To Create Ms Access Table And Add Fields In C Sharp - Enter Table Name
How To Create Ms Access Table And Add Fields In C Sharp – Enter Table Name


Now you will see two columns the first one is Field name and the second one is Datatype.

How To Create Ms Access Table And Add Fields In C Sharp - Add Fields
How To Create Ms Access Table And Add Fields In C Sharp – Add Fields


The Field Name column stores the the names of the table columns and the second one defines the column types or the type of data that will be stored in different columns. After you create each field name its advisable to give it a Data Type.
i.e. Text, Integer, etc.
The First Field name (ID) is auto generated. This is the tables primary key.
So i am going to add other columns of type text.
And one of type OLE Object. This one will store image files as bytes.

How To Create Ms Access Table And Add Fields In C Sharp - Add Fields Names And Datatypes
How To Create Ms Access Table And Add Fields In C Sharp – Add Fields Names And Datatypes

Leave a Reply

Your email address will not be published. Required fields are marked *