Configuring SQL Server for ASP.NET


This article is about how to Install SQL Server for ASP.NET. Suppose, you have installed Visual Studio or VWD, and SQL Server also. But you are unable to access the SQL Server Directly in your ASP.NET Applications.

Microsoft Visual Studio or Visual Web Developer for Developing ASP.NET applications or Websites. Microsoft SQL Server for storage.
If you are one of the us and installed Both in your machine to develop. Congratulations, you have all the powers.

But if, you did some modifications at the time of installation of SQL Server and chosen Named Instance and gave a custom name. When you build an ASP.NET application and started to work with Database Related stuffs like ASP.NET membership, storing Sessions etc, your application will not connect to Database, instead throw an Error telling Network/Instance failure because Visual Studio knows SQLEXPRESS but, you did not installed it and modified with another name.

This article is only how to prepare SQL Server custom Instance for ASP.NET database related jobs.

As you know, same thing can be done using many methods. Same for this, you can install this Using SQl Server itself, Command Prompt, Graphical way. I am going to tell you about 2 ways below.
One is Command Mode and another is Visual Mode (Windows Explorer)

Method 1 : Command Mode


Step 1 for Method 1:
Open Visual Studio Command Prompt as Administrator

Type Below Commands in Dos Prompt.

cd..

cd..

cd Program* //Program Files

cd Microsoft Sql* // Microsoft SQL Server folder

cd MSSQL10.[Instance Name] // Version of SQL Server (In my case SQL Server 2008 so MSSQL10 and Name in my case SQLDB)

cd MSSQL

cd INSTALL



Lets see below Snapshot, with above Codes :

Configuring SQL Server for ASP.NET-1

Note : Above mentioned code is Location of the Installation File. This may vary according to your Operating System. Above code and screenshot is taken for/using Windows 8.

Type Below Command in Above location.


aspnet_regsql -c "Complete Data Source"

//or below Code

aspnet_regsql


Step 1 for Method 2:

Open your Windows Explorer
Go to C Drive (System Root Drive) of your Harddisk
Go to Program Files directory.
Go to Microsoft SQL Server directory.
Select your SQL Instance Name and choose Folder to Open.
Again Click MSSQL Folder inside instance name.
Open Install folder
and Double Click on aspnet_regsql.exe file.

Note:You can search for aspnet_regsql.exe file in your Start Menu or Smart Screen search if using Windows 7 or Windows 8 Respectively. The Rest is same.
Step 2:

If you just type Second one, you will get easier to get into this.
You will be followed by Wizard as below:

Configuring SQL Server for ASP.NET-2
Click Next :

Configuring SQL Server for ASP.NET-3
Click Next to Continue :

Configuring SQL Server for ASP.NET-4
Fill your Instance Name and authentication mode and details and also you can choose your own Database. After finishing with these Click Next and Next to Finish the Process.
If you see below screen, you have successfully done it.

Configuring SQL Server for ASP.NET-5

Congratulations, you have done it. You have now successfully configured SQL Server for your ASP.NET Applications.

You can drop a comment below or send me message if you have any suggestion/feedback.

Glad to Be,
John Bhatt


Comments

No responses found. Be the first to comment...


  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: