473,756 Members | 1,818 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

String was not recognized as a valid Boolean

c2
hi,
i face a problem when click the icon , my login will prompt this
message
String was not recognized as a valid Boolean

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.FormatEx ception: String was not recognized as a valid Boolean.
at System.Boolean. Parse(String value)
at System.Convert. ToBoolean(Strin g value)
at CrossDock.Commo n.CrossDockFlag .SetSystemFlag( )
at CrossDock.frmLo gin.Form1_Load( Object sender, EventArgs e)
at System.EventHan dler.Invoke(Obj ect sender, EventArgs e)
at System.Windows. Forms.Form.OnLo ad(EventArgs e)
at System.Windows. Forms.Form.OnCr eateControl()
at System.Windows. Forms.Control.C reateControl(Bo olean
fIgnoreVisible)
at System.Windows. Forms.Control.C reateControl()
at System.Windows. Forms.Control.W mShowWindow(Mes sage& m)
at System.Windows. Forms.Control.W ndProc(Message& m)
at System.Windows. Forms.Scrollabl eControl.WndPro c(Message& m)
at System.Windows. Forms.Container Control.WndProc (Message& m)
at System.Windows. Forms.Form.WmSh owWindow(Messag e& m)
at System.Windows. Forms.Form.WndP roc(Message& m)
at
System.Windows. Forms.Control.C ontrolNativeWin dow.OnMessage(M essage& m)
at
System.Windows. Forms.Control.C ontrolNativeWin dow.WndProc(Mes sage& m)
at System.Windows. Forms.NativeWin dow.Callback(In tPtr hWnd, Int32
msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
the message seems point out Form1_Load has problem, but i don't where
the bug is?

however, when i using ide run the same program , the login page is ok
no error prompt

Please give me comments and thank in advances

Sep 7 '07 #1
3 3960
On 7 Sep, 11:58, c2 <szeyee.t...@gm ail.comwrote:
hi,
i face a problem when click the icon , my login will prompt this
message
String was not recognized as a valid Boolean

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.FormatEx ception: String was not recognized as a valid Boolean.
at System.Boolean. Parse(String value)
at System.Convert. ToBoolean(Strin g value)
at CrossDock.Commo n.CrossDockFlag .SetSystemFlag( )
at CrossDock.frmLo gin.Form1_Load( Object sender, EventArgs e)
at System.EventHan dler.Invoke(Obj ect sender, EventArgs e)
at System.Windows. Forms.Form.OnLo ad(EventArgs e)
at System.Windows. Forms.Form.OnCr eateControl()
at System.Windows. Forms.Control.C reateControl(Bo olean
fIgnoreVisible)
at System.Windows. Forms.Control.C reateControl()
at System.Windows. Forms.Control.W mShowWindow(Mes sage& m)
at System.Windows. Forms.Control.W ndProc(Message& m)
at System.Windows. Forms.Scrollabl eControl.WndPro c(Message& m)
at System.Windows. Forms.Container Control.WndProc (Message& m)
at System.Windows. Forms.Form.WmSh owWindow(Messag e& m)
at System.Windows. Forms.Form.WndP roc(Message& m)
at
System.Windows. Forms.Control.C ontrolNativeWin dow.OnMessage(M essage& m)
at
System.Windows. Forms.Control.C ontrolNativeWin dow.WndProc(Mes sage& m)
at System.Windows. Forms.NativeWin dow.Callback(In tPtr hWnd, Int32
msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************
the message seems point out Form1_Load has problem, but i don't where
the bug is?

however, when i using ide run the same program , the login page is ok
no error prompt

Please give me comments and thank in advances
Your English is atrocious but your error is happening under:

frmLogin

on the procedure called: Form1_Load

You are trying to cast a string into a boolean. are you sure your not
doing this:

if ("hello") then

or

if (username) then

instead of (if username = "value") then

You basically comparing a string value to a boolean value. Without
seeing the code I can't tell you which variable is wrong exactly.

Phillip Ross Taylor

Sep 7 '07 #2
c2 wrote:
the message seems point out Form1_Load has problem, but i don't where
the bug is?
Look again:

System.FormatEx ception: String was not recognized as a valid Boolean.
at System.Boolean. Parse(String value)
at System.Convert. ToBoolean(Strin g value)
at CrossDock.Commo n.CrossDockFlag .SetSystemFlag( )
at CrossDock.frmLo gin.Form1_Load( Object sender, EventArgs e)

Form1_Load() is calling Common.CrossDoc k.SetSystemFlag () which is
calling Convert.ToBoole an() to convert a String value into a Boolean
one. Ly guess would be that the String value just happens to be empty
("") at this point.
however, when i using ide run the same program , the login page is ok
no error prompt
Print out (to a file, a MsgBox, or whatever) the value being passed to
Convert.ToBoole an in the SetSystemFlag routine.

If that doesn't give you any clues, post the code in the SetSystemFlag
routine.

HTH,
Phill W.
Sep 7 '07 #3
On Sep 7, 6:58 am, c2 <szeyee.t...@gm ail.comwrote:
hi,
i face a problem when click the icon , my login will prompt this
message
String was not recognized as a valid Boolean

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.FormatEx ception: String was not recognized as a valid Boolean.
at System.Boolean. Parse(String value)
at System.Convert. ToBoolean(Strin g value)
at CrossDock.Commo n.CrossDockFlag .SetSystemFlag( )
at CrossDock.frmLo gin.Form1_Load( Object sender, EventArgs e)
at System.EventHan dler.Invoke(Obj ect sender, EventArgs e)
at System.Windows. Forms.Form.OnLo ad(EventArgs e)
at System.Windows. Forms.Form.OnCr eateControl()
at System.Windows. Forms.Control.C reateControl(Bo olean
fIgnoreVisible)
at System.Windows. Forms.Control.C reateControl()
at System.Windows. Forms.Control.W mShowWindow(Mes sage& m)
at System.Windows. Forms.Control.W ndProc(Message& m)
at System.Windows. Forms.Scrollabl eControl.WndPro c(Message& m)
at System.Windows. Forms.Container Control.WndProc (Message& m)
at System.Windows. Forms.Form.WmSh owWindow(Messag e& m)
at System.Windows. Forms.Form.WndP roc(Message& m)
at
System.Windows. Forms.Control.C ontrolNativeWin dow.OnMessage(M essage& m)
at
System.Windows. Forms.Control.C ontrolNativeWin dow.WndProc(Mes sage& m)
at System.Windows. Forms.NativeWin dow.Callback(In tPtr hWnd, Int32
msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************
the message seems point out Form1_Load has problem, but i don't where
the bug is?

however, when i using ide run the same program , the login page is ok
no error prompt

Please give me comments and thank in advances
While error printouts are nice - what we need is the actual code that
goes into the form load event handler. Also, you should have been able
to add a breakpoint in the method and then step through to find the
exact line that was causing the problem. It also might help you to
turn on Option Strict (just type "Option String On" at the top of the
code file), option strict will stop most of these implicit castings
which lead to runtime exceptions.

Thanks,

Seth Rowe

Sep 7 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
12725
by: Sterling Ledet | last post by:
I am trying to create a web service that takes a string from my web server in the following format: Mon, 6 Oct 2003 18:39:47 UTC and put's in a datetime so it can then be reformatted in C# as necessary for variuos purposes. There is something wrong with the following code. I get the following error when I enter in the above date string:
1
2510
by: adolf garlic | last post by:
I'm having a problem with dates. (No not the sort that you have at christmas) I have a webform with a text box and a calendar control. You can either - enter a date manually (we are talking uk style here dd/mm/yyyy) in the textbox - click a date on the calendar which puts the date value in the textbox (uk style)
0
4896
by: RSH | last post by:
I am having a bit of trouble filling a datatable with a query. I'm getting the error message: System.FormatException: String was not recognized as a valid DateTime. at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles) at System.DateTime.Parse(String s, IFormatProvider provider, DateTimeStyles styles) at System.DateTime.Parse(String s, IFormatProvider provider) at System.Convert.ToDateTime(String value,...
9
7135
by: rsine | last post by:
I have developed a program that sends a command through the serial port to our business system and then reads from the buffer looking for a number. Everything worked great on my WinXP system, but when I tried the program on the Win98 system it will be running on, I get the following error: Cast from string "2076719" to type 'Long' is not valid I am not sure why I only get this error on the Win98 system or how to go about correcting...
11
33322
by: Bob Day | last post by:
The IsDate code below should result in False, instead it throws the exception below. Why? How do I check if a string can be converted to a date if this function does not work properly? Bob code: Dim blnDate_Valid As Boolean = True Dim x As String = "Hello"
16
2152
by: Mark A. Sam | last post by:
Hello, I am having a problem with imputting into a string variable: Dim strSQL As String = "INSERT INTO tblContactForm1 (txtName, txtCompany, txtPhone, txtEmail, txtComment, chkGrower, chkProduceDealer, txtOtherCustType, chkStandardBags, chkCustomBags,txtOtherBags) " + _ "VALUES ('" + txtName.Text + "','" + txtCompany.Text + "','" + txtPhone.Text + "','" + txtEmail.Text + "','" + txtComment.Text + "','" +
10
16428
by: dba123 | last post by:
Why am I getting this error for Budget? Error: An exception of type 'System.FormatException' occurred in mscorlib.dll but was not handled in user code Additional information: String was not recognized as a valid Boolean. Public Sub UpdateCustomer_DashboardGraphs(ByVal sender As Object, ByVal e As System.EventArgs)
1
4704
by: database | last post by:
I AM FACING A PROBLEM WHEN I ACCESS ONE OF THE PAGES. IT USED TO WORK BEFORE BUT AFTER RESTARTING THE APPLICATION SEVER IT GIVES THE FOLLOWING ERROR. - Server Error -------------------------------------------------------------------------------- The string was not recognized as a valid DateTime. There is a unknown word starting at index 20.
0
883
by: absentia.no | last post by:
I am using a datagrid and have a column which should consist of checkboxes. The datafield that generates the checkbox-column is bit, but I am getting this format error: System.FormatException: String was not recognized as a valid Boolean. If I use boundField instead everything works fine, but I want to use the checkboxes as it seems very odd to make my users type in 0 or 1 manually to decide wether to turn off or on. Also, I have made...
0
758
by: Andres Bohren | last post by:
Hi i have a GridView and have Problems to put the values into the right Datatypes. Protected Sub GridView1_RowUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GridView1.RowUpdating Dim intID As Integer = GridView1.DataKeys(e.RowIndex).Value.ToString() Dim strDatum As String = GridView1.Rows(e.RowIndex).Cells(2).Text
0
9456
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9872
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8713
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7248
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5142
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5304
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3805
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3358
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2666
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.