s but instead of exception message i have given to return false result ;
mbjino
Posts
-
HI ANYBODY PLS HELP ME ! -
HI ANYBODY PLS HELP ME !no error message thats making it more bad :( :( :(
-
HI ANYBODY PLS HELP ME !i tried it but the prob is the if part is not getting executed insted its going to catch part!
-
HI ANYBODY PLS HELP ME !HI THIS IS MY C# PROGRAM I WANT TO GET A BOOLEAN RESULT TRUE OF FALSE I DIDNT FIND ANY ERROR....BUT THE PROB IS ONLY THE EXECPTION PART IS GETTING EXECUTED...ITS A LOGIN PAGE,....
public bool validateuser(User u)
{
bool result = true;
try
{
string validateq = "select count(*) from register where user.username = @username and user.password = @passwd ";
cmd = new SqlCommand(validateq, con);
cmd.Parameters.AddWithValue("@username", u.username);
cmd.Parameters.AddWithValue("@passwd", u.password);
con.Open();
reader = cmd.ExecuteReader();
reader.Read();
int r = Convert.ToInt32(reader[0]);
if (r > 0)
{
result = true;
}
else
{
result = false;
}
return result;} catch (Exception ex) { result = false; return result; } }
-
hi frndshi frnds im doing a project and in a face of adding a forum in my project so is there anyone who can help me....with code or ideas regd forum in .net c#.....im new here and wish ur help and support dear friends........ :-O :-O :) :)