Shining Star Services LLC

Creating a Custom Membership Provider and Membership User utilizing a Data Set Table Adapter - Step 3

by Nannette Thacker

Creating The DataSet

As indicated in the previous step, after adding the connection to the web.config file, or if you desire to skip manually adding the connection to the web.config file, continue on with setting up your DataSet.

Now we are ready to add a new Data Set. In the Solution Explorer, right click the DataSets folder you setup in the App_Folder and select the "DataSet" template item. Give your new dataset a name. In my example, I name it "SSNetDataSet.xsd." Now select "Add."


A new, empty DataSet will open. Then a dialog box will open asking you to "Choose your data connection." It will default to the connection as setup in your web.config file as shown below. Select the web.config data connection and then select the "Next" button.



Optionally,
if you decided to allow the setup to add the connection string to the configuration file and did not specify a connection within your configuration file, you may create a "New Connection" as shown in the above screen, or existing connections will display in the drop down list. Once you have selected an existing connection, or created a new one, a dialog box will ask you to "Save the Connection String to the Application Configuration File." If you use this method, your configuration file connection string will be populated automatically. In the below example, I have it save the connection string in my web.config file as "SSNetConnectionString."



After using either method, the next step is to "Choose a Command Type." In the below wizard step, we will "Use SQL Statements." Select the "Next" button again.



A popup screen will allow you to select an existing table, view or function. In our example, we are selecting our "Users" table. Then select the "Add" button and "Close" button.



In our Query Builder, we will now check the checkbox next to "All Columns" in order to add all columns from the table. Optionally, you may check only the columns desired to be used in this data set.



Select "OK." This will return you to the "Enter a SQL Statement" screen of the Wizard. Select the "Advanced Options" button. In our example, we do not want to generate an Insert, Update, or Delete statement, so we uncheck that checkbox and select "OK."



Select the "Next" button and the below screen will appear. We have unchecked the "Fill a DataTable" checkbox and renamed our "Return a DataTable" method name to "GetUsers." Since our query returns all users in the table, we have opted to name it "GetUsers." Don't worry about selecting a user by userID or userName yet. We will create those next.



Select the "Next" button and the Wizard will now generate the SELECT statement, table mappings, and Get method.



We are now ready to begin Step 4: Step 4: Creating the Table Adapter Methods for GetUserByLogin, GetUserByUserName, and InsertUser.

Steps for Creating a Custom Membership Provider and Membership User utilizing a DataSet Table Adapter:

Introduction: Creating a Custom Membership Provider and Membership User utilizing a DataSet Table Adapter.
Step 1: Creating the Project and Folders.
Step 2: Table Data Structure and Web.config for this Tutorial.
Step 3: Creating The DataSet.
Step 4: Creating the Table Adapter Methods for GetUserByLogin, GetUserByUserName, and InsertUser.
Step 5: Creating our Custom MembershipProvider Class.
Step 6: Adding Properties to Our Custom MembershipProvider Class.
Step 7: Creating Our Custom MembershipUser Class.
Step 8: Customizing our MembershipProvider Class.
Step 9: Our Custom RoleProvider Class.
Step 10: Our Master page.
Step 11: Our Cookie Handler class.
Step 12: Our Log In page.
Step 13: Our Register page.
Step 14: Our Log Out page.
Step 15: Our Change Password page.
Step 16: Our Administration page.
Step 17: Loading a Menu Programmatically based on Roles.
Step 18: Our Default page.
Download the ZIP files:
VB: ShiningStarCustomMemberProviderTutorial.zip
© Copyright 1997-2017 Shining Star Services LLC, Nannette Thacker. All Rights Reserved.