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
Kavi suja
NA
298
171.2k
ASP.NET C# MySql
Apr 27 2013 6:15 AM
Hi,
i'm new to this field.Now i'm trying to create login form with MySql as DB.I've following error.
Can anyone help me?
On SubmitButton_Click onclick event:
string constr = "server=localhost;user name=root;password=pwd;database=contacts";
MySqlConnection con = new MySqlConnection(constr);
query = "SELECT Count(*) FROM contacts WHERE username='" + nametxt.Text + "' AND password='" + pwdtxt.Text + "'";
MySqlCommand com = new MySqlCommand(query, con);
con.Open();
string result = string.Empty;
int aa = Convert.ToInt32(com.ExecuteScalar().ToString());
con.Close();
if(aa==0)
{
lblerr.Text = "Invalid username or password";
}
else
{
Response.Redirect("detailadd.aspx");
}
error:
unhandled exception by user
Thanks in advance
Reply
Answers (
4
)
help barcode scanner toturial
StatusBar always visible on the winform.