Membership login with mysql

50 pts.
Tags:
ASP.NET
C
MySQL
hi, i doing a login program which will be using mysql. I would like to how do i do that, I have done a little but i am stuck half way can anyone help? protected void Login1_Authenticate(object sender, AuthenticateEventArgs e) { MySqlConnection conDatabase = new MySqlConnection("Server=localhost;Persist Security Info=no;User ID=Administrator"); MySqlConnection cnnVideos = new MySqlConnection("Network Address=localhost;" + "Initial Catalog='login';" + "Persist Security Info=no;" + "User Name='root';" + "Password=''"); }

Answer Wiki

Thanks. We'll let you know when a new response is added.

Create a stored procedure in the MySQL database (if you have a version which supports procedures) which has input parameters for the username and password. Pass it the username and password and within the procedure have it check a table and see if the username and password exist in a single row. Something like this.

<pre>CREATE PROCEDURE MyProcedure
@UserName nvarchar(50),
@Password nvarchar(50)
AS
SELECT 1
FROM YourTable
WHERE UserName = @UserName
and Password = @Password
GO</pre>

Then if there is no record it’s not a valid account. If there is a record it is a valid account.

This <a href=”http://www.c-sharpcorner.com/UploadFile/dclark/InsOutsinCS11302005072332AM/InsOutsinCS.aspx”>page </a>has come good info about using stored procedures.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following