Let's add the membership provider to our code and configure our application to use it.
Before we get started, we will need a place to store our new logins in the database. Execute the following SQL to create the "Login" table in our "Ordering" database with SQL Server Management Studio (SSMS):
CREATE TABLE [dbo].[Login]( [Id] [int] IDENTITY(1,1) NOT NULL, [Active] [bit] NOT NULL, [Email] [varchar](255) NULL, [FirstName] [varchar](255) NULL, [LastName] [varchar](255) NULL, [UserName] [varchar](255) NOT NULL, [Password] [varchar](255) NOT NULL, [PasswordQuestion] [varchar](255) NULL, [PasswordAnswer] [varchar](255) NULL, [Salt] [varchar](255) NOT NULL, CONSTRAINT [PK_Login] PRIMARY KEY CLUSTERED ( [Id] ASC ) )
Now you will need to create a Login POCO, a Login Data Control (DAO), and add the XML mapping files. Refer to the previous chapters if you need a little help.
Add a new class to the
Ordering.Data
project called...