source: https://forums.microsoft.com/technet/showpost.aspx?postid=110168&siteid=17&sb=0&d=1&at=7&ft=11&tf=0&pageid=1
brilliant!
I Have Solved This Problem... THANX JOEY ... You really Helped everyone ..
anyhow im going to tell a little Detail to readers ....
This is About Using MS SQL SERVER 2005(Non Express Version) ..... with Rolebased Member ship .....
1. First we need to Setup the DATABASE in the MS SQL SERVER 2005 to use for the Role based member ship ....
Go to Start > Program Files > Visual Studio 2005 > Visual Studio Tools > Visual Studio Command Prompt...
There just type this Command
aspnet_regsql.exe
and press enter...
It will start a wizard ... in the wizard .. Give your MS SQL SERVER 2005 Instance Name... lets say ... ASIF\SQL2K5 (Where Asif is my Computer Machine name and then Slash and then SQL2K5 is the SQL Instance name i gave while i was installing MS SQL SERVER 2005 you can also sometime have it like (localhost) Hope it will work for you in your case... in simply this is the DATA SOURCE name what you use in your Connection String usually...) Then you can choose an Existing Database ... lets say ... DB_Existing ... which is already residing in my database Engine ... But i can also Give the New Name like ASPNET .. it will Upgrade the Previous (if exists) or Create a new DB with TABLES Neccessary to setup a complete Membership in ASP.Net to use ASP.Net Readymade conrols....
Then press Finish or OKAY whatever ....
If you will go to the Database you will see that there is a complete setup made by that Wizard you ran ....
2. We need to setup this Database for use by the *ASP.Net Website configuration Tool*.
Go to Control Panel > Administrative Tools > Internet Information Service > Expand to the Default Website.. Right Click on the "WEBSITES" node (which is PARENT Node of the Default Website Node) .. > Properties > ASP.Net > Edit Configuration > Genral Tab > ConnectionString Manager ...
SO WE ARE AGAIN HERE .. here you will see that the connection string is WRONG(according to the MS SQL SERVER 2005 .. its setup for MSSQL Express Edition with a default database given named something like ASPNET DB whatever....you JUST NOW Change that thingy to you OWN connection String What Suites your MS SQL SERVER 2005 Instance .. )
My personal String is:
Data Source=Asif\SQL2K5;integrated security=SSPI;initial catalog=aspnet;
KOOOOOOOOOL !!!
3. One more thing ... Giving Access to ASPNET User to use MS SQL SERVER 2005 DBs
Sometimes you have setup your ASPNET System Account for using MS SQL SERVER 2005 Databases,, in that case it will NOT get Connected and Right on the Connection.Open(); it will Throw Exception .... In this case (i mean if you dont have permisions to Connect ASPNET application to Connect to MS SQL SERVER 2005 ...)
Run MS SQL SERVER 2005 Management Studio from
Start > All Programs > Microsoft SQL SERVER 2005 > SQL Server Management Studio
Connect to the Database Instance .... using your Windows Authentiaction simply
then Right Below the DatabasesNode press the *SECURITY* Node... there you will Right Click the Node: Logins > New Login (from Right Click Context Menu) > Press Search Button > Advanced > Find Now > Choose the ASPNET Account .. and Press OK > OK and Finally OK ....it will Give your ASPNET account to access the Databases while you will be using IIS Browsing ETC ETC ....
now go to your Visual Studio 2005 and run the *Website Configuration Tool* .. from
Website (Main Menu) > ASP.Net Configuration >
Huff .. !!!! HERE WE ARE .................
Now You people will be Able to Surely Connect to your DB
Hope it will help you ...
I'm Going to write the NEXT Tutorial to Use that ASPNET DB for programming Rolebased Security by using that ASP.Net configuration tool and then Customize it ..
You people will find this Tutorial on http://codeproject.com .. later.. on other day i will post the Code Project Link here .... there i will also paste the Print screen images...
BYE Have a Good connectivity to Databases Smile
* Asif Ashraf
* Microsoft Certified Application Developer for .Net
* Microsoft Certified Professional
* Asif.log@gamil.com || hotmail.com
* Asif@Colossys.com
* Project Manager, Sr. Developer Colossys LLC Reg.
Doing MCP in C#