|
Estou tentando utilizar o codigo de membership and role provider, mas da erro de dsn, configurei a connectionstring sendo a mesma da minha base de dados e criei as tabelas la, mas nao consigo conexao na base, alguem pode ajudar por favor?
Essa eh minha connectionString
connectionString="DATABASE=ldsimoveis;DSN=ldsodbc;OPTION=0;PORT=0;UID=ldsimoveis"
|
|
|
|
|
Cara de pau de escrever em portugues ein? :P
Seguinte, vc tah tentando conectar via ODBC? Acho q isso ai soh funciona com o Connector ADO...
|
|
|
|
|
Everything went ok except....The following message may help in diagnosing the problem: Could not load type 'Andri.Web.MySqlMembershipProvider'. (C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config line 47)
Im lost.
|
|
|
|
|
In MySQL the character to use to specifically identify a table name is `
For these tables, it is unnecessary to use the single quotes around the names.
This is the new code below...
CREATE TABLE Roles
(
Rolename varchar (255) NOT NULL,
ApplicationName varchar (255) NOT NULL
);
CREATE TABLE UsersInRoles
(
Username varchar (255) NOT NULL,
Rolename varchar (255) NOT NULL,
ApplicationName varchar (255) NOT NULL
);
ALTER TABLE UsersInRoles ADD INDEX (Username, Rolename, ApplicationName) ;
ALTER TABLE Roles ADD INDEX (Rolename, ApplicationName) ;
CREATE TABLE Users (
PKID varchar(36) NOT NULL default '',
Username varchar(255) NOT NULL default '',
ApplicationName varchar(100) NOT NULL default '' ,
Email varchar(100) NOT NULL default '',
`Comment` varchar(255) default NULL,
`Password` varchar(128) NOT NULL default '',
PasswordQuestion varchar(255) default NULL,
PasswordAnswer varchar(255) default NULL,
IsApproved tinyint(1) default NULL,
LastActivityDate datetime default NULL,
LastLoginDate datetime default NULL,
LastPasswordChangedDate datetime default NULL,
CreationDate datetime default NULL,
IsOnLine tinyint(1) default NULL,
IsLockedOut tinyint(1) default NULL,
LastLockedOutDate datetime default NULL,
FailedPasswordAttemptCount int(11) default NULL,
FailedPasswordAttemptWindowStart datetime default NULL,
FailedPasswordAnswerAttemptCount int(11) default NULL,
FailedPasswordAnswerAttemptWindowStart datetime default NULL,
PRIMARY KEY (`PKID`)
);
|
|
|
|
|
The single quotes are really only necessary around table names that are also Reserved Words (such as Password).
|
|
|
|
|
|
I apologize for breaking the link! Didn't realize I had. The files should be back up and working again. I had inadvertantly removed them so I had to reconvert hte code and the SQL, let me know if you find any errors. The link above now works again.
|
|
|
|
|
Have you tested the password recovery control with you code? This code causes an unhandled MembershipPasswordException that the passwordRecovery control doesn't catch. I've been investigating how to solve, but to no avail.
To recreate just plop a PasswordRecovery control and enter a username on first view, then enter a wrong answer and it will give an error.
Any help would be appreciated.
|
|
|
|
|
Disregard the prior post. I was running the website in debug mode and the debugger caught the exception before the passwordrecovery control did, so when you run it in release, the control acts normally.
|
|
|
|
|
|
Thanks for the convertion, but I get loads of errors, all about 'MySql...' isn't defined. Why is that?
|
|
|
|
|
You will need the MySQL Connector / NET for it to function properly. You can get it here:
MySQL Connector[^]
You can place the DLL into the bin/ folder of your application, or if using Visual Studio, Add it to your project (make sure you tell it to Copy) and it should work fine.
I am working on a large compiled web application at this point and used this code as a reference to write my own provider as I needed to match a specific Database Schema. If you've placed these in your App_Code folder but would like to have them pre-compiled, you may move them out of your App_Code folder and set them to Compile rather than Content within the Visual Studio IDE.
Thanks,
Dustin
|
|
|
|
|
I apologize for breaking the link! Didn't realize I had. The files should be back up and working again. I had inadvertantly removed them so I had to reconvert hte code and the SQL, let me know if you find any errors. The link above now works again.
|
|
|
|
|
Hello...
I want to creat a login session in my asp.net(vb) website and mysql database,but I do not know which is the best suitable way to do this,Do I use the bulit in login in asp.net or create my own session?
Can you explane in details?
Thank you..
|
|
|
|
|
Supposedly, there is an updated version of this at:
http://sprinj.com/ideas/view/5-a-mysql-membership-and-role-provider-for-aspnet-20
But the link to the source code seems to be broken. Does anyone know where I can find it?
|
|
|
|
|
I was wondering, like all people who do ... is there a vb version of this MySQL Membership and Role providers? I develop all my stuff in VB enviroment. I know I should go to C#, if I had a nickle for everytime I heard that. But anyways, I will give my first born to get ahold of that same code converted in vb. Well mabey not my first born, but If I have a second one I would consider it. Im on Yahoo messenger live on my phone as 'srbytes'.
Thanks guys,
Chris
|
|
|
|
|
An easy way to make your own VB set of these files is compile them into a class library, then use .NET Reflector to disassamble them into VB.
1. File>> New Project>> C# Class Library
2. Delete class1.cs
3. Add references to System.Web, System.Configuration, MySQL.Data
4. Add the 2 C# files from this download
5. Open up Lutz Reoder's .NET Reflector
5.1 Realizing you are a VB developer, you probably don't have this... so go download it.
6. Open up the assembly in the tool, change the output language to VB, drill down to the appropriate class, right click and choose dissasemble. The code will appear in the right. Scroll down and choose to expand methods. Voila, your very own VB copy of the code.
Other options: grow a set and move to C#.
|
|
|
|
|
Could you mind convert a VB version for me?
Thank you ver much!
|
|
|
|
|
Sorry!
could you mind tell me more detail about how to use Lutz Reoder's .NET Reflector?
|
|
|
|
|
please!!!
anybody can help me!
i ready cannot change it to vb version, and i don't where should place this code..
HELP! HELP!
|
|
|
|
|
Hi. Has anyone got the PasswordRecovery control to work with this membership provider? If I enter an incorrect answer to the password recovery question then I get an unhandled MembershipPasswordException. The provider code looks correct, exactly as shown in microsoft's sample... for some reason it looks like the PasswordRecovery control isn't handling the exception.
Any ideas?
Thanks.
|
|
|
|
|
did you ever figure out the fix for this(the password recovery control throwing an error)? I hit the same wall, and need a way out.
thanks,
Jose
|
|
|
|
|
Hi Jose,
I'm afraid the answer is 'no'. I eventually gave up on using the PasswordRecovery control and just implemented a solution using a Wizard control instead.
|
|
|
|
|
Hey I figured it out!! Since you're running it in debug, visual studio will always catch the exception. The PasswordRecovery is set up to catch it, but the visual studio gets it first. If you actually upload it to a site and run the program, the passwordrecovery control catches the exception and doesn't allow you to go forward.
Hope that helps,
Jose
|
|
|
|
|
I'm on a shared hosting account and I get this exception when trying to run a create account web control:
That assembly does not allow partially trusted callers
Does anyone know how to fix this?
Thanks,
Gabriel
|
|
|
|