.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan
Fauzul Azmi
Asad Ali
Post New Web Links

Repairing .NET Membership database

Posted By:      Posted Date: September 15, 2010    Points: 0   Category :ASP.Net
 
Hi! I have a problem with my Membership provider database. For example, when I try to delete a user in the Web Site Admin Tool, I get this message: The DELETE statement conflicted with the REFERENCE constraint "FK__aspnet_Me__UserI__40257DE4". The conflict occurred in database "intra", table "dbo.aspnet_Membership", column 'UserId'. The statement has been terminated. at System.Web.Administration.WebAdminPage.CallWebAdminHelperMethod(Boolean isMembership, String methodName, Object[] parameters, Type[] paramTypes) at ASP.security_users_manageusers_aspx.Yes_Click(Object sender, EventArgs e) at System.Web.UI.WebControls.Button.OnClick(EventArgs e) at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) I think it's because I copied the database from SQL Server 2000 to our new SQL Server 2007 and that they aren't fully compatible. I know about the aspnet_reqsql.exe tool, and I could probably delete the tables and


View Complete Post


More Related Resource Links

connect client certificate to an account in a membership database

  
Hello I have created a web service that authenticates with username and password, works fine.Basically this one, http://msdn.microsoft.com/en-us/library/ff649647.aspxNow I also want to connect to this web service using client certificates, works finehttp://msdn.microsoft.com/en-us/library/cc948997.aspx But I would like to when authenticated via client certificates, connect that certificate to a user in the membership database.So that I can use Roles.IsUserInRole(...) and such.I thought that, well if I implement a Custom certificate Validatorhttp://msdn.microsoft.com/en-us/library/ms733806.aspxthen I could check for example subject and map that against a created username in the membership database.But in the class X509CertificateValidatorpublic override void Validate(X509Certificate2 certificate)I don't have the same ability as when the user is authenticatedlike  void OnAuthenticateRequest(object source, EventArgs eventArgs)HttpApplication app = (HttpApplication)source;Basically how can I do this app.Context.User = new GenericPrincipal(new GenericIdentity(username, "Membership Provider"),roles);withinpublic override void Validate(X509Certificate2 certificate)and if that is not possible, can this be solved differently?Bottom line, how do I connect a client certificate to a user account in the membership database. Is there a MSDN article

user mapping to a database and role membership to that database

  
When assigning a 'user mapped Login' to a database and role membership to that database, is it redundent to check/enable db_datareader, db_datawriter as well as db_owner or will check/enable db_owner become all that is necessary to provide role membership to the database?

problem in setup database membership

  
 Hello everyoneThe teeming seen on this video http://www.asp.net/general/videos/how-do-i-set-up-the-sql-membership-provider Which explains the addition of a database to the project AlympirchibBut as they applied to explain and I had a problem, he says, Stop the server failed to note that I have is the name of the device and the database and set the defaultNo one can tell me what is the solution or the requirements for the work thanks

Migrating ASPNET Role/Membership Database to New Server

  

Hello,

I have an existing ASPNET role/membership database created on SQLExpress 2005 (WIndows 2003 Server). I created it under the .NET 3 framework many years ago using the aspnet_regsql.exe application in full GUI mode. 

I am setting up a new Windows 2008R2 server with .Net Framework 4 and SQL Server 2008R2. I don't want users to have to recreate accounts or create roles, etc.

So...

1. Should I backup the current database and import it into the new system, and if so do I even need to use the aspnet_regsql.exe application. (If so which version do I use, different aspnet_regsql.exe files exist in different directories (i.e., FrameWork, FrameWork64)


2. Should I just run aspnet_regsql.exe on its own and then somehow try to import the current data into those tables.


I am concerned that if I just import somehow the roles within SQL server will not be created properly. 

thanks in advance,

mitch


security for membership database

  

Hi folks,

I am working on an asp.net application with membership controls and the SQL Server database.  I have this put together, however it appears that adjustments need to be made to enhance security.  Many websites have membership features, so I was wondering if there are some blog posts that describe the steps that need to be made to enhance security.  Can someone make a few recommendations?

thanks 


Website without any default membership Database. Is it possible?

  

I am in the initial stage of implementing a new webstie, which will use only twitter and facebook to login and use. So my approach is not use any Default memberhip database, just simple store the user data in my created "membership" database. I will set cookies and use sessions to restrict and grant access to various parts of the sites. So for example, the user creates an account and I set a cookie allowing him or her to traverse the site. And on each page request from the client browser check to see if my website cookie is there in the browser and if it has expired or not. Is this approach veasible? Thanks


Could not establish connection database. ASP.NET Membership and Entity Framework

  

Ok, so this is my first Solution using the Entity Framework (EF). Here are my steps so far:

1) Created Database named: BSA with an owner of username/password (AspNetServicesUser/password)
2) Created Entity Data Model (EDM) in a separate project (contained within the same solution)
3) Created an ASP.NET Web Application with basic functionality (new project within the same solution)
4) Added Reference to the EDM in Web App and added Connection String to the EF
5) Decided I wanted ASP.NET Membership added to the Web App
6) Configured SQL Server for Application Services using aspnet_regsql.exe on BSA database

Now, I need to know:
a) Should I keep the ASP.NET Membership Tables in a Separate DB altogether?
b) Should I update the EDM to include the ASP.NET Membership Tables?
c) Then, how do I create the connectionString for the Web.config file in the WebApp?


FYI: I get this error using the ASP.NET Configuration Tool under the "Security" Tab:
Login failed for user 'AspNetServicesUser'.

FYI: I get this error using the ASP.NET Configuration Tool under the "Provider" Tab --> Select a single provider for all site management data --> Test
Could not establish a connection to the database. 
If you have not yet created the SQL Server database, exit the

ASP Membership database

  

I am working on a conversion of a website with user authentication. The new version now uses the ASP Membership login control and database. I want to transfer the users of the old site into the ASPMembership database. The password field of the current user table is not encrypted, so I cannot insert the usernames and passwords through a query into the table asp_membership the login, I would need the encryption algorythm that Microsoft put behind the login control. How can I de- and encrypt passwords before passing them into the table?


Unable to connect to Database | ASP.NET Membership and Entity Framework

  



Ok, so this is my first Solution using the Entity Framework (EF). Here are my steps so far:

1) Created Database named: BSA with an owner of username/password (AspNetServicesUser/password)
2) Created Entity Data Model (EDM) in a separate project (contained within the same solution)
3) Created an ASP.NET Web Application with basic functionality (new project within the same solution)
4) Added Reference to the EDM in Web App and added Connection String to the EF
5) Decided I wanted ASP.NET Membership added to the Web App
6) Configured SQL Server for Application Services using aspnet_regsql.exe on BSA database


Now, I need to know: 
a) How do I create the connectionString for the Web.config file in the WebApp?


Errors I receive:

I get this error using the ASP.NET Configuration Tool under the "Security" Tab:

Login failed for user 'AspNetServicesUser'.


I get this error using the ASP.NET Configuration Tool under the "Provider" Tab --> Select a single provider for all site management data --> Test

Could not establish a connection to the database. 

If you have not yet created the SQL Server database, exit the Web Site Administration tool, use the aspnet_regsql command-line utility to create and configure the database

Membership Provider - Login fails after change in database name

  

Hi Experts,

I am in the process of deploying an website developed in ASPNet 2.0 and using the login control and membership provider features. The site was deployed fine and was working perfectly till I changed the database name and user name to access the database. I changed the accordingly in the web.config to point to the new database. Everyting is working file except when the user tries to login into the website.

The error log says that login failed because it is trying to open the old database.

Any idea how I can solve the issue? Thanks for your help.

Regards,

Sudipta


I need help with adding membership tables to app_data folder database

  

The following code is used to add the asp membership tables to an already existing database instead of creating a seperate database for membership and having two databases in the application.

aspnet_regsql.exe -S .SQLEXPRESS -U username -P password -d databsename -A all

It works fine by adding the membership tables to the existing database that is located in the c drive, program files  sqlserver folder.

But my database however is not in the c drive but located in my asp website app_data folder, so the above code does not give any error and the tables are not added after I run it.

Please how can I now add the membership tables using the above code when my database is located in the website app_data folder, thanks



Pointing my programs to the aspnet membership files in my SQL database

  

I used aspnet_regsql to add the aspnet membership files to my database, but my program is not finding them there. It is updating some other set somewhere elelse. When I click the hammer icon, I can see the members and roles, my program finds them as well, but they are not in my database. I need to get it attached to my SQL database so I can deploy to hosted site.

 

Thanks 


Database Role membership for MSDB database alone

  

Hi,

           I do like to find the query to list out all the available database role membership identities for msdb database. For other database i pull out the list of database role membership from sys.database_principals whose principal_id ranges between 16384-16393. For msdb database there seems to be much of database roles and it is not available in sys.database_principals. Kindly help me out in pulling out all the database roles for msdb database alone.

 

Regards,

Jeisurya


Multiple database support with Entity Framework

  
One of the features introduced in Entity Framework is being database independent. Which mean each database provider can support Entity Framework by implementing its provider.

This feature allows you build applications independent from the underplaying database provider. In this post I'm going to show how to build an application that support multiple databases using same conceptual model made by Entity Framework.

Export Visio Database Table Names to Excel

  
If you use the Enterprise Architect edition of Microsoft Visio for data modeling regularly, then there is a good chance that at some point you've wanted to export just the table names into Excel. You might want to do this to map logical ERD entities to physical data model tables, track project status by entity, or track overlap between database versions.

MS SQL Server: Disconnect Users From Database - Kill User Session

  
If you ever wanted to restore your database from a SQL backup file (.bak), but there are still users connected to your database, the backup operation will fail causing the error: Exclusive access could not be obtained because the database is in use.

Publishing SQL Server Database using Publishing Wizard : Tips & Tricks

  
We can use SQL Server Publishing Wizard to deploy our local Database to remote hosting server/production server.This feature is available in SQL Server 2008/VWD 2008.

Below is the complete step by step guide of this process.
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend