Creating a script ad table structure for ASP.NET

I am creating an AppHarbor MVC3 application and want to use standard membership provider support. The guys at AppHarbor told me that I need to create a script for the table structure that I can run in my AppHarbor database. However, I am not very familiar with databases. How do I create and execute a script for default membership tables?

+4
source share
2 answers

Use the aspnet_regsql.exe command line. See http://msdn.microsoft.com/en-us/library/ff648345.aspx . Excerpts:

Step 2. Install the membership database

Before you can use the SqlMembershipProvider, you must install the SQL Server membership database.

To install the membership database, log in to your server with an account that has authority to administer SQL Server (for example, an administrator account). Open a Visual Studio 2005 command prompt and run the following command:

aspnet_regsql.exe -E -S localhost -A m

Where:

-E indicates authentication using the Windows credentials of the current registered user. -S (server) indicates the name of the server on which the database will be installed or already installed. -A m indicates the addition of membership support. This creates the tables and saves the procedures required by the members of the provider. Note. The Aspnet_regsql tool is also used to set database items for other ASP.NET 2.0 features such as role management, Profile, Personalization Web Parts, and Web events. The other command line arguments perform database operations for these other functions. You can use Aspnet_regsql without any command line arguments using the wizard, which allows you to specify connection information for your SQL Server and install or remove database items for all supported features.

+5
source

There is a great article here: http://www.nashcoding.com/2011/02/05/using-the-forms-authentication-membership-provider-on-appharbor/comment-page-1/#comment-477

1. Enter the Visual Studio command prompt by choosing Start β†’ All Programs β†’ Visual Studio 2010 β†’ Visual Studio Tools β†’ Visual Studio Command Prompt.

2. Run the following command using the AppHarbor database settings to fill in the values ​​in brackets: aspnet_regsql.exe -S [Host] -d [Name] -U [Username] -P [Password] -A all

3. In the MVC project, open the Web.config file.

4. Replace the connectionString for ApplicationServices with the connection string found on your AppHarbor database page.

0
source

Source: https://habr.com/ru/post/1338578/


All Articles