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
shima
NA
36
0
login page
Jul 18 2009 7:47 AM
hi
I have problem with login form in c#
I think this problem from
if statment
private
void
button1_Click(
object
sender,
EventArgs
e)
{
SqlConnection
con =
new
SqlConnection
(
"Data Source=.;Initial Catalog=pjt;Integrated Security=True"
);
con.Open();
SqlCommand
com =
new
SqlCommand
();
com.Connection = con;
com.CommandText =
"SELECT * FROM LOGIN WHERE username='"
+ tusername.Text +
"' AND password="
+ tpassword.Text +
"'"
;
SqlDataReader
dr =com.ExecuteReader();
if
(
Convert
.ToBoolean(com.CommandText))
{
Menu
oform =
new
Menu
();
oform.Show();
}
else
{
MessageBox
.Show(
"username or password incorrect"
);
}
con.Close();
Reply
Answers (
5
)
Adding row dynamically inside the table
Combination of Random Numbers