How to Create a Database table in Visual Studio 2010

If  You are new in asp.net database related work then i suggest you first go through this article
How to Create a Database/Connect to a Database in Visual Studio 2010

1.File-> New-> Website->  ASP.NET Web Site(Visual C#) -> Ok

2.Click Solution Explorer-> Double click on Your Database->Your window should look like this.





















Right Click on Tables->Click Add New Table(You will look a window like this)
















*Column Name:Here you will write your attribute name
*Data Type:You will select your data type by clicking the drop down list
*Allow Nulls:If you checked the check box then you must have to put data when inserting.(primary key didn't allow nulls) .
















To set primary key->Right click on User_id(black arrow beside User_id)->click Set Primary Key

Click ctrl+s(or click save to save your table)-> you will promt a window->Write your desired table name(here i write Login)->Ok

(To see your table add or not)->click solution explorer->click table(you will see your table list)
In this way you can add more Tables as you want.

















If you have any problem with this article, please just leave a comment.

No comments:

Post a Comment