Error 'Input string was not in a correct format'


Author
Message
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
It sounds like you have an InitialSearchValue in the text box that is not visible that is not a number but represents a numeric field.  The stack strace shows that the BuildWhereElement is trying to convert the text value into a number.  Since you are receiving an error then there has to be a value in the textbox.  If it is not visible, then it would have to have been set in your property sheet and you must have provided an initial search value (this can be done programatically as well).  When you rearrange the fields, the search values are cleared out....thus you do not get the error.
Chan
Chan
Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)
Group: Forum Members
Posts: 533, Visits: 2K
Hi,

I hit error 'Input string was not in a correct format' when click search in browse dialog.



Steps to repduce

1. Drop browsedialog on to form.

2. Specify search fields. Try to have search field that similar with below.

Search Field 1 : Textbox, String, Visible = true

Search Field 2 : Combobox, Integer, Visible = false

Search Field 3 : Textbox, String, Visible = true

3. Specify other properties.

4. Run the form, click browse button, and click search in browse dialog.



Error below would be occurred. The error happen if I have non-character search field set to invisible at the middle of other string search field. It works fine if I move search field 2 after search field3.



FormatException

Input string was not in a correct format.



Source : mscorlib



Stack Trace:

at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)

at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)

at System.Int32.Parse(String s)

at MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialogwindow.BuildWhereElement(SearchFieldItem SearchField)

at MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialogwindow.BuildWhereElement(Int32 ParameterIndex)

at MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialogwindow.BuildSearchWhereClause()

at MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialogwindow.ExecuteSearch()

at MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialogwindow.ProcessCmdKey(Message& msg, Keys keyData)

at System.Windows.Forms.Control.ProcessCmdKey(Message& msg, Keys keyData)

at System.Windows.Forms.ContainerControl.ProcessCmdKey(Message& msg, Keys keyData)

at System.Windows.Forms.TextBoxBase.ProcessCmdKey(Message& msg, Keys keyData)

at System.Windows.Forms.MaskedTextBox.ProcessCmdKey(Message& msg, Keys keyData)

at System.Windows.Forms.Control.PreProcessMessage(Message& msg)

at System.Windows.Forms.Control.PreProcessControlMessageInternal(Control target, Message& msg)

at System.Windows.Forms.Application.ThreadContext.PreTranslateMessage(MSG& msg)

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search