uhm...I have been checking all of your tutorials Paladine...they are great, I've tried the C# example and it worked quite well...nonetheless, as I am a newbie in asp.net :( I've been tryng to do the login page using mysql and hell I've been having lots and lots of trouble... wonder if you could guide me pls hehe
btw..my problems start with the stored procedure, which I think I kinda adapted in mysql 5, but, I don't think it's working.....also may have problems with the connection... so bad...
as I said, I tried to adapt the C# with sql server example you posted before....here are fragments of the code I think are wrong:
[in the code behind]
.......
private bool DBConnection(string tUser, string tPass)
{
//I couldn't make it work in the web.configure :(
OdbcConnection myConn = new OdbcConnection("DRIVER={MySQL ODBC 3.51 Driver};SERVER=localhost;DATABASE=database;UID=uid;PASSWORD=password;OPTION=3;");
OdbcCommand myCmd = new OdbcCommand("sp_ValidateUser", myConn);
myCmd.CommandType = CommandType.StoredProcedure;
.......
returnParam = myCmd.Parameters.Add("@Num_of_User", OdbcType.Int);
objParam1.Direction = ParameterDirection.Input;
objParam2.Direction = ParameterDirection.Input;
returnParam.Direction = ParameterDirection.Output;
......
now, this is the stored procedure I made (got a table named "users"):
CREATE PROCEDURE `sp_ValidateUser`(IN UserName Varchar(50), IN Wachtwoord Varchar(50), OUT Num_of_User INT)
BEGIN
SELECT COUNT(*)
INTO Num_of_User
FROM users
WHERE user = UserName
AND password = Wachtwoord;
END
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
and finally the error I got:
System.Data.Odbc.OdbcException: ERROR [23000] [MySQL][ODBC 3.51 Driver][mysqld-5.0.24-community-nt]
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sp_ValidateUser' at line 1 at System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle, RetCode retcode) at System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior behavior, String method, Boolean needReader, Object[] methodArguments, SQL_API odbcApiMethod) at System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior behavior, String method, Boolean needReader) at System.Data.Odbc.OdbcCommand.ExecuteNonQuery() at _Default.DBConnection(String tUser, String tPass)
I think I really need help hehe :P..... thanx in advance :)