Solved

Who to convert a look up field to a boolean field dynamically using C#

Posted on 2013-05-09
2
361 Views
Last Modified: 2013-05-10
I have an application that has a checkbox on the app. When the user checks the checkbox the name of the person in the lookup field on another form needs to be inserted on an ssrs report. I need to know who to accomplish this. I get an error message with the code that I have now.
Error Message:
String was not recognized as a valid Boolean.

Code below:
Line 185:                        chkSEWP.Checked = Convert.ToBoolean(rpt_submittedtosewp);
Line 186:                        SEWPDateTxt.Text = rpt_sewpdate;
Line 187:                        chkShowServiceSupportRep.Checked = Convert.ToBoolean(rpt_servicesupportrep);

 
Please help. Thank you

Open in new window

0
Comment
Question by:newjeep19
2 Comments
 
LVL 16

Accepted Solution

by:
Easwaran Paramasivam earned 500 total points
ID: 39154247
The value could be "".

chkSEWP.Checked = Convert.ToBoolean(rpt_submittedtosewp); should be changed as below.


chkSEWP.Checked =  rpt_submittedtosewp.toLower() == "true" ? true:  ( rpt_submittedtosewp == ""  ? false : true)

Open in new window



Likewise change your third statement as well.
0
 

Author Closing Comment

by:newjeep19
ID: 39155793
Very excellent....thank you very much!
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Written by Valentino Vranken. Introduction: The first step of creating a SQL Server Reporting Services (SSRS) report involves setting up a connection to the data source and programming a dataset to retrieve data from that data source.  The data…
Hi, I have heard from my friends that it’s not possible to create Label Printing report using SSRS. I am amazed after hearing this words not possible in SSRS. I googled lot and found that it is possible to some of people know about the Report Bui…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now