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
sumaira manzoor hussain khan
NA
241
251.6k
Error occur in CSharp
Sep 2 2011 2:12 AM
hello everyone;
i am writing a code . in the colored area ,there are exception occur .the exception are :
The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator.
protected void Button_login_Click(object sender, EventArgs e)
{
object obj = null;
SqlConnection mycon = new SqlConnection();
mycon=connection.get();
//mycon = connection.get();
Session["username"] = TextBox_user_name.Text;
Session["password"] = TextBox_password.Text;
string s = "select count(*) from login where user_name='" + Session["username"] + "' and password ='" + Session["password"] + "'";
SqlCommand cmd = new SqlCommand(s, mycon);
obj = cmd.ExecuteScalar();
if (Convert.ToInt32(obj) != 0)
{
Label_display_user_name.Text = "WELLCOME :: " + Session["user_name"];
}
else
{
Label_result.Text = "invalid user name and password";
}
}
regards
sumaira
Reply
Answers (
6
)
Quick Book SDK for Addon
Export gridview to excel file