Last post Mar 15, 2016 02:45 AM by Angie xu - MSFT
Mar 09, 2016 03:51 PM|stevenfrankeventium|LINK
I have a web forms web site project newly-created in VS 2015.
I am using the integrated account services to manage users, etc.
Of course, everything works great on my development workstation.
Everything, except the DB access works great when I deploy to the server (Windows Server 2012).
The server is already running SQL Server Express so I don't need to use LocalDB and as long as it's all already there, I'd just as soon use SQL Server Express to manage the DB on the server side.
I've taken a shot at this by using SQL Server Management studio to Attach to the MDF/LDF files that are published with the site but this has not worked.
The attached works and I can do some things, but others error out. Worse, when I modify the connection string for the site to use SQL Server Express instead of LocalDB, I get a run-time error about it trying to create the database and not being able to.
Clearly, I've done something wrong. Before getting into trying to salvage what I've done, is there a better/proper way to use SQL Server Express with the DB created by the site template?
Mar 09, 2016 10:09 PM|stevenfrankeventium|LINK
I've made some progress here but am still stuck.
I have the DB created on the server and it is working as far as it goes. In other words, I am able to log in with a user that I created.
On to the next step, using Roles and that is where I'm having issues.
I have run aspnet_regsql.exe and that went fine. However, it seems to have created a different set of tables, the aspnet_blah vs what I had previously, which is the AspNetBlah (i.e. aspnet_Users vs AspNetUsers)
My site, which is built from VS 2015 using, what I presumed was, an up to date template is using the AspNetUsers, etc. but when I add a Role in that set of tables, methods such as Roles.GetRolesForUser() do not work (they seem to be using the aspnet_ set
Is this controlled from the entries in web.config as to which providers are being used?
I'm really confused why my log is working, but the roles are not? Are there other methods I should be using to look at roles in the 'older' model the web site template seems to be using?
Mar 15, 2016 02:45 AM|Angie xu - MSFT|LINK
Welcome to asp.net forum.
From your description above, it seems that this issue is more related to aspnet_Users and AspNetUsers. AFAIK, dbo.aspnet_Users has difference design with dbo.AspNetUsers. I'm not sure the root of this issue, perhaps this article can give some tips to understand
aspnet_Users and AspNetUsers better, see:
SQL Membership to ASP.NET Identity