468,119 Members | 2,072 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,119 developers. It's quick & easy.

Can't quite get the Membership/Roles configured to work on SQL 2005

Hello,

I need some help in getting my simple web app to work. I can't seem to get
the configuration of the Membership/Roles working by pointing my website to
a SQL 2005 database as opposed to the default App_Data\ASPNETDB.MDF file.

I've got two boxes, one with XP & VS2005 and the other is windows 2003 with
IIS 6.0, ASP.NET 2.0 & SQL Server 2005 (Not SQL 2005 Express).

My app simply has one user called 'administrator' assigned with the role
called 'Administrator'. This user can logon, and some of the pages show the
administrator-specific content. Otherwise, its just anonymous view. I've
used the Web Site Administration Tool to configure this.

I can get the administrator to login (Using the ASP.NET login control), but
it doesn't show the Administrator-specific content.
Here is a typical web page:

<asp:LoginView ID="LoginViewMain" runat="server">
<RoleGroups>
<asp:RoleGroup Roles="Administrator">
<ContentTemplate>
... Administrator-specific content goes here ...
</ContentTemplate>
</asp:RoleGroup>
</RoleGroups>
</asp:LoginView>

And when I browse to a page like this, the local PC whirrs away, and it
creates the App_Data\ASPNETDB.MDF file. It shouldn't do this - I think it's
not pointing to the server correctly??

I've run the aspnet_sqlreg file which created the ASP.NET-specific tables in
my database, and I put the related connection string in the web.config. I
know it connects, because anonymous users can see content comming from my
content tables in this database.

My web.config has:

<authorization>
<allow roles="Administrator" />
<allow users="?" />
</authorization>

<roleManager enabled="true"/>

<authentication mode="Forms" />

<membership>
<providers>
<clear/>
<add name="AspNetSqlMembershipProvider"
connectionStringName="MyConnectionString"
type="System.Web.Security.SqlMembershipProvider, System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</providers>
</membership>

And it all seems to be OK.

Can anyone suggest why it creates the App_Data\ASPNETDB.MDF during execution
when it should authorize against the SQL2005 database?

Regards,
Jack.


Aug 13 '06 #1
0 863

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Scatir | last post: by
1 post views Thread by John | last post: by
5 posts views Thread by JP.Gantlin | last post: by
2 posts views Thread by Brandon Holliday | last post: by
1 post views Thread by =?Utf-8?B?ZVByaW50?= | last post: by
4 posts views Thread by =?Utf-8?B?cm9kY2hhcg==?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.