473,396 Members | 1,780 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 992

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Dan Sikorsky | last post by:
Can I use SQLServer 2000 with ASP.NET 2.0 instead of SQLServer 2005, and use the .Net 2.0 Membership functionality? I've setup my Login page, controls, etc., and now it's time to use the Web...
6
by: Scatir | last post by:
Hi, I have a membership problem I couldn't resolve. I have set up membership as most of tutorial instructed, and I am able to log on, but cannot stay log on for some reason. ex: when I log on, the...
1
by: John | last post by:
Hi I have looked in help but am not clear how to do the following in vb.net code. 1. Check if a user belongs to a specific role. 2. Change user's password. Is it possible to do it without...
5
by: JP.Gantlin | last post by:
I want to have a login page where the new user self-registers, giving some simple info like Real Estate Agent #. Do I need to used the membershiop/roles thing, or profiles? Are profiles part...
5
by: Mahernoz | last post by:
Hi Everyone! I have a problem here. I have used the latest asp.net membership & profiles functionality in my site. I have 2 roles admin and user. I also have a user named admin. Now, my...
2
by: Brandon Holliday | last post by:
Hello, I have a problem that I need some help on. I am creating a website that utilizes the builtin membership functionality in Asp.net 2.0. By default, the "AspNetSqlProvider" is used and...
4
by: alexandis | last post by:
There are tons of articles about custom role and provider membership, but they just tear me apart and confuse :( The situation is following: I use DB2, so I wrote custom role + membership...
1
by: =?Utf-8?B?ZVByaW50?= | last post by:
Asp.Net v2.0 I have created a web application and I am using it from a single website and database. The web application has different ‘portals’ – each independent and I am using the...
4
by: =?Utf-8?B?cm9kY2hhcg==?= | last post by:
hey all, i just ran aspnet_regsql on my database server. now, will all my applications use this single database or do i need to run aspnet_regsql for each new application? thanks, rodchar
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.