hello fellow istoryans please ko sa inyu help
unsaon pag catch ani to have an trapping nga mo ingun og invalid password sa ako login form
please help thak you!
hello fellow istoryans please ko sa inyu help
unsaon pag catch ani to have an trapping nga mo ingun og invalid password sa ako login form
please help thak you!
another open source assignment... tsk tsk... sayun ra kaau.. e open source pa gyud..
pag linq nlng. ug mag linq ka mag buhat ka ug sql to linq nga class tapos i drag nimo ang table.
so in.ani ang code anah. kay medyo taas ra na imo code
sa imo button n.ania nlng
//[name of the datacontext] variable_name = new [name of the datacontext]();
DataClasses1DataContext db = new DataClasses1DataContext();
// var any_variable_name = from any_table_holder_var_name in db.[table_name] where any_table_holder_var_name.column == txtUser.Text select any_table_holder_var_name;
var query = from a in db.tbl_user where a.username == txtUser.Text select a;
if(query.Count() > 0)
MessageBox.Show("Successfully Logged In");
else
MessageBox.Show("Invalid Username or Password");
pero ug nhan ka mag ado n.ania
public bool login(string user){
con.Open();
string sql = "SELECT * FROM USERS WHERE USERNAME='"+user+"'";
SqlCommand query = new SqlCommand(sql,con);
query.ExecuteNonQuery();
SqlDataReader rdr = query.ExecuteReader();
count = 0;
while(rdr.Read()){
count++;
}
if(count >0)
return true;
else:
return false;
}
sa button nimo n.ania
if(login(txtUser.Text))
MessageBox.Show("Successfully Logged In!");
else
MessageBox.Show("Invalid Username or Password");
Similar Threads |
|