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
Thiyaga Raja
NA
5
12.9k
An expression of non-boolean type specified in a context whe
Sep 11 2013 6:39 AM
I have created registration.aspx page. the Code behind file is given below...
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack)
{
SqlConnection con = new SqlConnection("Data Source=THIYAGU-PC\\SQLEXPRESS;Initial Catalog=SriSri;Integrated Security=True");
con.Open();
string cmdstr = "select count(*) from Registration where '" + TextBoxUN.Text + "' ";
SqlCommand cmd = new SqlCommand(cmdstr, con);
int temp = Convert.ToInt32(cmd.ExecuteScalar().ToString());
con.Close();
if (temp == 1)
{
Response.Write("User Name Already Exist.....!!! <br> Please Try Some other User Name....!!!");
}
}
}
This is my table for Registration.aspx page.
CREATE TABLE [dbo].[Registration](
[UserId] [int] NOT NULL,
[UserName] [nvarchar](20) NULL,
[Password] [nvarchar](15) NULL,
[EmailAddress] [nvarchar](50) NULL,
[FullName] [nvarchar](50) NULL,
[Country] [char](10) NULL,
)
while executing error has coming like this...
An expression of non-boolean type specified in a context where a condition is expected, near 'HBHBH'.
How to find the solution.kindly any one help me to do this process..
Thank u so much....
Reply
Answers (
4
)
How to display current date in gridview?
How to save the data from grid view to sqlserver?