How to Create Database using Visual Studio 2013(SQL Server)

How to Create Database

– Creating a Database is very common things in most of the developers, however for a beginner like me creating one is a bit of a struggle, especially if you are just starting to learn and understand programming. So I decided to create a simple instruction to share what I learn in different ways on how to access SQL Servers. If you are using Visual Studio as your development environment, it might be familiar to you if we are going to use Visual Studio SQL object Explorer to browse for the database. If not, let me guide you using simple instruction written below.

Let’s Start: 

1. First Open Visual Studio and go to View->SQL Server Object Explorer

How to Create Database

SQL Object Explorer

2. By default SQL Object Explorer contains available SQL server. You can also add Server by simply clicking on the icon with a plus sign located at the topmost part of your SQL Server Object Explorer

How to Create Database

Connect to database

3. After clicking on the add server icon, a dialog box will show. Input server name to add the server to your Object explorer. You can use Windows authentication for authentication type, however if you set a password for your server, you might need to input valid credentials for your authentication.

How to Create Database

Connect to Server

4. Image below is my local server I added in my SQL Server Object Explorer.

How to Create Database

SQL Server Object Explorer

5. Add database to your server, expand your server and right click on Database folder then Select Add New Database. See image below.

How to Create Database
How to Create Database

Add Database

6. Create Database window will pop-up. Name your database to your likings.

How to Create Database

Name Database

7. Creating a Table. Navigate again to your SQL server, expand Database folder and under your Database right click on the Table 

How to Create Database

Add Table

8. A new window should be open in the middle pane containing default id column which is set to primary.

 

How to Create Database

Table design

9.  Set id to auto increment by highlighting the id column and going to properties located just below your solution explorer. Expand Identity Specification and set (Is Identity) to true.How to Create Database

10. Now go back to the middle pane and add additional column we need for our table.How to Create Database

11. To save changes you made to your table click on update button located above your table design then click Update Database on the next pop-up window which is the image below.How to Create Database

12. To see if table is successfully created go to your SQL Server Object Explorer and expand your database and go under Table If you haven’t see your table yet right click on your database an click refresh.                         How to Create Database

13. You can also view table data by right-clicking on your table and selecting View DataHow to Create Database

14. And in the middle pane, you can see available data for your table.How to Create Database

You’re done!

Thank you for reading!!

Happy Coding!!

 


Post you may like:

SOLVED: An unexpected error occurred in the .NET Framework Data Provider for MySQL

If you are here I’m expecting that you encountered same problem as mine. I was transferring a DataSet file to ...
Read More

How to create custom 404 error handler in ASP.NET MVC

Custom 404 error handler - 404 Error refer to a not found resource/URL . Here’s how a default 404 Error ...
Read More

AngularJS CRUD Operation using ASP.NET MVC

I am a .NET Developer and I’m new in AngularJS. I started using AngularJS in about a week ago and ...
Read More
SignalR Chat App With ASP.NET

SignalR Chat Application with ASP.NET MVC

SignalR Chat App With ASP.NET - This article will show you an actual application using SignalR in ASP.NET MVC. The ...
Read More
AgularJS

Submit Forms using AgularJS with ASP.NET MVC

Ways on how to submit forms using AngularJS: I’m new to AngularJS and I was trying to create a CRUD application ...
Read More
Self Signed Certificate

How: Creating Self Signed Certificate

As defined in sslshopper.com. A self-signed certificate is a certificate that is signed by the person creating it rather than a trusted ...
Read More
AngularJS

AngularJS with Asp.Net MVC

What is Angular? AngularJS is a JavaScript framework that extends HTML attribute to help develop a dynamic Web application. AngularJS ...
Read More

Importing Excel with ASP.NET MVC

Importing excel, In my previous article, I demonstrated how to perform simple way of downloading data into excels. Now, this ...
Read More

Export Data to Excel with ASP.NET MVC

In creating a system there are times that we need to export data to excel, it could either be for ...
Read More

Easy Steps to Implement Partial View in Asp.Net MVC

One of the best ways to implement a dynamic table without loading the whole page is by using Jquery Ajax ...
Read More

Leave a Reply

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