First, you have to export the security data to your database. Let's assume your database is named MyDatabase. If you are using the Database Deployment Toolkit, use the deployment package wizard to bring in the security structures and data.
Look at the help topic in the DDT Help for more details: Deployment Data Packages -> Deployment Package Wizard
Once you have created the Deployment Data Packages, you MUST deploy the DDT profile to your SQL Server before the changes and security data are deployed to the "MyDatabase" database in your server. To deploy, click the Deploy To Server button within the DDT.
Be sure to re-create the packages when prompted.
Once this has been completed and you have deployed the data and structures to your server. THEN you can access these settings within your application. If you are using "MyDatabase" or your application database to house the security tables and data, then make sure to set the following value in the InitApplication of your AppMain.vb or Program.cs file:
SecurityBasics.SecurityDataSourceKey = ""
If you are specifying a different data source connection and database for your security to be housed, then let me know and I will post some different code.
At this point you should be able to run your application and properly access the security data.