TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
alaa
NA
166
84.8k
test field value in datatables
Jun 19 2014 10:53 AM
hi
i want to select username and password for only user who are confirmed from admin else alret message that it is still un confirmed this my code behind which i try
public bool Login(string user, string pass)
{
string sel = string.Format("SELECT * FROM Tbl_Users WHERE U_UserName ='{0}' and U_PassWord ='{1}'", user, pass);
DataTable tbl = Search(sel);
if ((tbl.Rows[13] = true) && tbl.Rows.Count == 1)
return true;
else
{
return flase;
}
}
the tbl.Rows[13] is for field index
protected void btnlogin_Click(object sender, EventArgs e)
{
Mem m = new Mem();
if (m.Login(txtuser.Text, txtpass.Text) == true)
{
utility.CreateCookie("login", new string[] {"U"},
new string[] {txtuser.Text}, ChkReM.Checked, Response);
Response.Write("<script> alert('login success');</script>");
Redirect(txtuser.Text);
}
else if (m.Login(txtuser.Text, txtpass.Text) == false)
{
// Response.Write("<script> alert('your account is not active');window.location='Default.aspx'; </script>");
}
else
{
Response.Write("<script> alert('error in user name or password');</script>");
}
}
Reply
Answers (
3
)
System.InvalidOperationException Timeout expired
duplicate in bootstrap javascript files