Advertisement

05.13.2008 at 09:47PM PDT, ID: 23400291
[x]
Attachment Details

Cannot implicitly convert type 'string' to 'bool'

Asked by kwh3856 in Microsoft Visual C#.Net, C# Programming Language, Visual Studio .NET 2005

Tags: Microsoft, Visual Studio 2005, C#, String to Bool

I am trying to test a textbox variable for data.  To the best of my knowledge, the text box has never been defined as a bool object.  Can someone tell me what I am missing.  Here is my code:



string clinical_pass = " ";

        if (Session.Contents["clinical_pass"] != null)
        {
            clinical_pass = Session.Contents["clinical_pass"].ToString();
        }




if (tbClinicalPassword.Text = clinical_pass)   --------------------------   error occurs here
        {
            // Do Stuff

        }
        else
            lblError.Text = "Invalid Password";Start Free Trial
 
 
[+][-]05.13.2008 at 09:52PM PDT, ID: 21561346

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Visual C#.Net, C# Programming Language, Visual Studio .NET 2005
Tags: Microsoft, Visual Studio 2005, C#, String to Bool
Sign Up Now!
Solution Provided By: rickson
Participating Experts: 2
Solution Grade: A
 
 
[+][-]05.13.2008 at 09:53PM PDT, ID: 21561349

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628