D
Daniel Groh
I have this method that returns a user:
SqlCommand sqlCmd = new SqlCommand();
sqlCmd.CommandType = CommandType.StoredProcedure;
sqlCmd.CommandText = "SP_Login";
SqlParameter paramEmail = new SqlParameter("@Email",SqlDbType.VarChar,60);
paramEmail.Direction = ParameterDirection.Input;
paramEmail.Value = strEmail.Trim();
sqlCmd.Parameters.Add(paramEmail);
SqlParameter paramPassword = new SqlParameter("@Password",SqlDbType.VarChar,100);
paramPassword .Direction = ParameterDirection.Input;
paramPassword .Value = strPassword.Trim();
sqlCmd.Parameters.Add(paramPassword );
sqlCmd.Connection = objConn.SQLConn;
SqlDataReader drUser = sqlCmd.ExecuteReader();
return (string) drUser[0]
BUT, it's going to the catch and throwing this error: Input string was not in a correct format.
The procedure is ok, I'm running in QueryAnalyser and everything is working, but in my application...not!
Could someone please help me ?
Thanks in Advance
SqlCommand sqlCmd = new SqlCommand();
sqlCmd.CommandType = CommandType.StoredProcedure;
sqlCmd.CommandText = "SP_Login";
SqlParameter paramEmail = new SqlParameter("@Email",SqlDbType.VarChar,60);
paramEmail.Direction = ParameterDirection.Input;
paramEmail.Value = strEmail.Trim();
sqlCmd.Parameters.Add(paramEmail);
SqlParameter paramPassword = new SqlParameter("@Password",SqlDbType.VarChar,100);
paramPassword .Direction = ParameterDirection.Input;
paramPassword .Value = strPassword.Trim();
sqlCmd.Parameters.Add(paramPassword );
sqlCmd.Connection = objConn.SQLConn;
SqlDataReader drUser = sqlCmd.ExecuteReader();
return (string) drUser[0]
BUT, it's going to the catch and throwing this error: Input string was not in a correct format.
The procedure is ok, I'm running in QueryAnalyser and everything is working, but in my application...not!
Could someone please help me ?
Thanks in Advance