hi,
plz help me how can i get the return value of mysql stored function from ASP.net with c#.
Currently i m using the following code for this purpose
string strConnect = "Data Source=" + host + ";Database=" + database + ";User ID=" + user + ";Password=" + password + ";Port=" + port;
MySqlConnection conn = new MySqlConnection(strConnect);
MySqlCommand cmd = new MySqlCommand("f_UserLogin", conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add(new MySqlParameter("username", txt_user.Text));
cmd.Parameters.Add( new MySqlParameter("pwd",txt_user.Text));
try
{
cmd.Connection.Open();
int res = cmd.ExecuteNonQuery();
if (res > 0)
{
txt_wronglogin.Text = "Success";
}
else
{
txt_wronglogin.Text = "na pa g";
}
}
catch (Exception ex)
{
txt_wronglogin.Text = ex.ToString();
}
Thanks and Best Regards,
Nice Candy