﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » WinForms (How do I?)  » Error 'Input string was not in a correct format'</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Fri, 11 Sep 2026 02:41:43 GMT</lastBuildDate><ttl>20</ttl><item><title>Error 'Input string was not in a correct format'</title><link>http://forum.strataframe.net/FindPost11725.aspx</link><description>Hi,&lt;br&gt;
I hit error 'Input string was not in a correct format' when click search in browse dialog. &lt;br&gt;
&lt;br&gt;
[u]Steps to repduce[/u] &lt;br&gt;
1. Drop browsedialog on to form.&lt;br&gt;
2. Specify search fields. Try to have search field that similar with below.&lt;br&gt;
    Search Field 1 : Textbox, String, Visible = true&lt;br&gt;
    Search Field 2 : Combobox, Integer, Visible = false&lt;br&gt;
    Search Field 3 : Textbox, String, Visible = true&lt;br&gt;
3. Specify other properties.&lt;br&gt;
4. Run the form, click browse button, and click search in browse dialog.&lt;br&gt;
&lt;br&gt;
Error below would be occurred. The error happen if I have non-character search field set to [b]invisible[/b] at the middle of other string search field. It works fine if I move search field 2 after search field3.&lt;br&gt;
&lt;br&gt;
FormatException&lt;br&gt;
  Input string was not in a correct format.&lt;br&gt;
&lt;br&gt;
Source     : mscorlib&lt;br&gt;
&lt;br&gt;
Stack Trace: &lt;br&gt;
   at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer&amp; number, NumberFormatInfo info, Boolean parseDecimal)&lt;br&gt;
   at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)&lt;br&gt;
   at System.Int32.Parse(String s)&lt;br&gt;
   at MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialog&amp;#119;indow.BuildWhereElement(SearchFieldItem SearchField)&lt;br&gt;
   at MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialog&amp;#119;indow.BuildWhereElement(Int32 ParameterIndex)&lt;br&gt;
   at MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialog&amp;#119;indow.BuildSearchWhereClause()&lt;br&gt;
   at MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialog&amp;#119;indow.ExecuteSearch()&lt;br&gt;
   at MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialog&amp;#119;indow.ProcessCmdKey(Message&amp; msg, Keys keyData)&lt;br&gt;
   at System.Windows.Forms.Control.ProcessCmdKey(Message&amp; msg, Keys keyData)&lt;br&gt;
   at System.Windows.Forms.ContainerControl.ProcessCmdKey(Message&amp; msg, Keys keyData)&lt;br&gt;
   at System.Windows.Forms.TextBoxBase.ProcessCmdKey(Message&amp; msg, Keys keyData)&lt;br&gt;
   at System.Windows.Forms.MaskedTextBox.ProcessCmdKey(Message&amp; msg, Keys keyData)&lt;br&gt;
   at System.Windows.Forms.Control.PreProcessMessage(Message&amp; msg)&lt;br&gt;
   at System.Windows.Forms.Control.PreProcessControlMessageInternal(Control target, Message&amp; msg)&lt;br&gt;
   at System.Windows.Forms.Application.ThreadContext.PreTranslateMessage(MSG&amp; msg)&lt;br&gt;</description><pubDate>Thu, 27 Sep 2007 11:07:43 GMT</pubDate><dc:creator>Chan</dc:creator></item><item><title>RE: Error 'Input string was not in a correct format'</title><link>http://forum.strataframe.net/FindPost11727.aspx</link><description>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.&amp;nbsp; The stack strace shows that the BuildWhereElement is trying to convert the text value into a number.&amp;nbsp; Since you are receiving an error then there has to be a value in the textbox.&amp;nbsp; 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).&amp;nbsp; When you rearrange the fields, the search values are cleared out....thus you do not get the error.</description><pubDate>Thu, 27 Sep 2007 11:07:43 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>