ASP.NET - aspnet_regsql - Asked By Priyanka on 15-Sep-11 04:19 AM

why to use sql server setup wizrad (aspnet_regsql)... what happen if i dont use this ??? how it will effect in my application ???
Web Star replied to Priyanka on 15-Sep-11 04:23 AM

This is tool to use installing sql server database 

see this for more details http://msdn.microsoft.com/en-us/library/ms229862%28v=vs.80%29.aspx

Aspnet_regsql.exe is a tool for installing the SQL Server database used by the SQL Server providers. The file is located in the "c:\WINDOWS\Microsoft.NET\Framework\versionNumber folder" on your web server. There are too ways to run this tool: the wizard form and the command line.

1. To run this using wizard is very simple. 
Step 1: Run the aspnet_regsql.exe from your command line without any arguments. Then the wizard windows form will appear.  Click the Next Button.

Step 1

Step 2: Choose what you want to do with the sql database. In this example we want to create a new application services database. So we just select the first option then Click the Next Button.

Step 2

Step 3: Enter your sql server name, authentication method and the database name. If the database has already existed, you can select the dropdownlist. If the database is new, you only need to type in the new database name in the dropdownlist. Click the Next Button.

Step 3

Step 4: Confirm the information then then Click the Next Button.

Step 4

Step 5: Done. 

Step 5

After that your database should be created. And it should look likes this.

sql server view

2. Also you can run the tool as a command-line utility. The options for the command are

Option Description
-? Prints Aspnet_regsql.exe tool Help text in the command window.
-W Runs the tool in wizard mode. This is the default if no command line arguments are specified.
-C connection string The connection string to the computer running SQL Server where the database will be installed, or is already installed. This option is not necessary if you only specify the server (-S) and login (-U and -P, or -E) information.
-S server The name of the computer running SQL Server where the database will be installed, or is already installed. The server name can also include an instance name, such as .\INSTANCENAME.
-U login id The SQL Server user id to log in with. This option also requires the password (-P) option. This option is not necessary if you are authenticating using Windows credentials (-E).
-P password The SQL Server password to log in with. This option also requires the login id (-U) option. This option is not necessary if authenticating using Windows credentials (-E).
-E Authenticates using the Windows credentials of the currently logged-in user.
-d database The name of the database to create or modify. If the database is not specified, the default database name of "aspnetdb" is used.
-sqlexportonly filename Generates a SQL script file that can be used to add or remove the specified features. The specified actions are not performed.
-A all|m|r|p|c|w Adds support for one or more features. The following identifiers are used for ASP.NET features.
all All features
m Membership
r Role management
p Profile
c Web Parts personalization
w Web events
Feature identifiers can be specified together or separately, as shown in the following examples. aspnet_regsql.exe -E -S localhost -A mp aspnet_regsql.exe -E -S localhost -A m -A p
-R all|m|r|p|c|w Removes support for one or more features. The identifiers are the same for the add option.. Here is some examples. aspnet_regsql.exe -E -S localhost -R mp aspnet_regsql.exe -E -S localhost -R m -R p
-Q Runs the tool in quiet mode and does not confirm before removing a feature
smr replied to Priyanka on 15-Sep-11 04:24 AM
Hi

The ASP.NET SQL Server Registration tool is used to create a Microsoft SQL Server database for use by the SQL Server providers in ASP.NET, or to add or remove options from an existing database. The Aspnet_regsql.exe file is located in the [drive:]\%windir%\Microsoft.NET\Framework\version folder on your Web server.

refer link
http://msdn.microsoft.com/en-us/library/ms229862%28v=vs.80%29.aspx
Riley K replied to Priyanka on 15-Sep-11 04:42 AM
The aspnet_regsql.exe runs the ASP.NET SQL Server Setup Wizard which allows you to create or configure a SQL Server database to store information for membership, profiles, role management, personalization, and SQL Web event provider.

Once created, you may use forms authentication and the login controls to access these tables.


You can run Aspnet_regsql.exe without any command-line arguments to run a wizard that will walk you through specifying connection information for your SQL Server installation, and installing or removing the database elements for the membership, role management, profile, Web Parts personalization, and health monitoring features.

refer this link
http://

Regards
Reena Jain replied to Priyanka on 15-Sep-11 06:44 AM
Hi,

When you install ASP.NET, the Machine.config file for your server includes configuration elements that specify SQL Server providers for each of the ASP.NET features that rely on a provider. These providers are configured, by default, to connect to a local user instance of SQL Server Express 2005. If you change the default connection string used by the providers, then before you can use any of the ASP.NET features configured in the machine configuration, you must install the SQL Server database and the database elements for your chosen feature using Aspnet_regsql.exe. If the database that you specify with Aspnet_regsql.exe does not already exist (aspnetdb will be the default database if one is not specified on the command line), then the current user must have rights to create databases in SQL Server as well as to create schema elements within a database.

Each SQL Server provider can use the same SQL Server database to store the data for that particular feature. Each feature can be used individually, or in conjunction with other features. For example, you could use role management by itself or in conjunction with the user information managed by membership.


Hope this will help you