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
Pranjal Mishra
NA
59
46.1k
login code
Oct 4 2012 12:25 PM
protected void btnlogin_Click(object sender, EventArgs e)
{
string strcon = ConfigurationManager.ConnectionStrings["pranjalConnectionString"].ToString();
SqlConnection con = new SqlConnection(strcon);
con.Open();
string email = txtEmailid.Text.Trim();
string passwd = txtPassword.Text.Trim();
string sql = "Select Email,password from reg_vidyatbl where Email='" + txtEmailid+ "'and password='" + txtPassword + "'";
SqlCommand cmd = new SqlCommand(sql, con);
cmd.ExecuteNonQuery();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet dt = new DataSet();
da.Fill(dt);
if (dt.Tables[0].Rows.Count > 0)
{
Response.Redirect("home.aspx");
}
else
{
lblerrorlog.Text = "invalid usernane or password";
}
this is my login code but it is not working properly,im directly getting error msg.control is not going insid the if codition.let me know if i ha made any mistake
Reply
Answers (
4
)
Diffrence between telerik and crystal reports?
Ajax control , masked validator? and masked edit exdender