[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Getting this error: Cannot implicitly convert type 'bool' to 'System.Guid'

Posted on 2013-05-13
8
Medium Priority
?
1,038 Views
Last Modified: 2013-05-14
I am trying to hide or show data on an SSRS report when a checkbox on a .NET application is checked. I am using c#.

My code is below:
 if (chkShowServiceSupportRep.Checked == true)
            {
                if (gtri_maintenanceid != Guid.Empty)
                {
                    servicesupportrep.Value = true; // causes error
                }
                else
                {
                    if (gtri_maintenanceid == Guid.Empty)
                    {
                        servicesupportrep.Value = false; // causers error
                    }
                }
            }

Open in new window


gtri_maintenanceid = Guid
servicesupportrep = Lookup

Please help
0
Comment
Question by:newjeep19
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 39162476
Is the above correct:  servicesupportrep is of type Lookup? Is it nullable?
0
 

Author Comment

by:newjeep19
ID: 39162481
Correct.....
private Lookup servicesupportrep = new Lookup();
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 39162500
Is Lookup a class you created? What is the type of the object returned by the Value property?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:newjeep19
ID: 39162530
The value retruned is the Guid of a person found via a Lookup
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 39162537
OK, so look at what you just said:

The value retruned is the Guid...

, and look at what you are trying to do in code:

servicesupportrep.Value = true;

How can you assign a boolean (e.g. true) to something that is of type Guid?
0
 

Author Comment

by:newjeep19
ID: 39162549
Thats what I am trying to figure out. I have a checkbox. If the checkbox is checked then I want the value of the Lookup (Guid) to be shpwn on a Report. So, the checkbox either hides or shows the lookup value.
0
 

Author Comment

by:newjeep19
ID: 39162776
I also tried this:
if (chkShowServiceSupportRep.Checked == true)
            {
                if (gtri_maintenanceid != null)
                {
                    servicesupportrep.Value = gtri_maintenanceid;
                }
                else
                {
                    if (gtri_maintenanceid == null)
                    {
                        servicesupportrep.Value = Guid.Empty;
                    }
                }
            }

Open in new window

0
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 1000 total points
ID: 39162796
IIRC, there should be a Visibility property on the control you are using to display the Lookup. You can set that expression to be the value of the chkShowServiceSupportRep check box's checked state. Have you tried putting anything in the Visibility field?

What kind of control are you using for the chkShowServiceSupportRep field?
0

Featured Post

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A recent questions about how to add SSRS named instances, couldn't find any that talks about SQL server 2008, anyway I decided to help by creating some screen shots. The installation is straightforward, you just pop the SQL server 2008 installati…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question