ERROR - BrowseDialog - Search Field Criteria

Author Message
 Posted 5/17/2008 6:26:08 AM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 5/21/2019 3:58:03 AM
Posts: 210, Visits: 641
BrowseDialog Error Crying

When the search criterion is configured in a field byte occurs an error of conversion of types.

It sees the archive attached and the image below.



Rogério Mauri

(www.licitec.com.br - Brazil)

 StrataFrameError.zip (25 views, 520.26 KB)
Post #16423
Add to Twitter Add to Facebook
 Posted 5/17/2008 8:45:34 AM
Strategic Support Team Member

Strategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team Member

Group: StrataFrame MVPs
Last Login: 6/15/2019 1:08:46 AM
Posts: 1,920, Visits: 21,109
Hi Rogerio.

As it looks like, you have defined your pk as Tinyint, which will be converted into Byte, and don't forget, this will limit the number of records on this table.

Not sure if this is the cause to the error you are getting. Would you like to test defining the field as Integer? Just to test. I'm sure the guys will give you a more in depth solution on this.

Post #16424
Add to Twitter Add to Facebook
 Posted 5/17/2008 11:16:59 AM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 5/21/2019 3:58:03 AM
Posts: 210, Visits: 641
Olá Ivan...

A escolha de 'tinyint' para esse campo chave primária é porque ele pertence a uma tabela que, na verdade, é um dicionário que nunca ultrapassará o limite de 255 registros.

Sempre que defino um campo numérico procuro ajustá-lo ao tipo mais econômico sem prejuízo do seu 'tempo de vida'. Por exemplo, para IDs(PKs) de tabelas de cadastro e movimento, utilizo o 'int'. Agora, para campos marcadores se situação/status apenas (referenciados em outras tabelas ou em enumeradores) escolho o menor tamanho possível: smallint ou tinyint. Com isso o banco de dados irá consumir menos espaço.

Um exemplo: Codificamos em uma tabela um campo numérico para diferenciar um status com três possibilidades exclusivas: (1-Pendente/2-Bloqueado/3-Finalizado). Então, por que utilizar um 'int' que irá consumir 4 bytes se posso perfeitamente acomodar a demanda em um tinyint que consome apenas 1 byte?

Notei que os desenvolvedores da MicroFour, nos exemplos - mesmo com enumeradores, utiliza o 'int'. Acredito que essa 'preferência' para o 'int' tenha deixado escapar algum 'bug' no código do 'Search Field Criteria' do 'BrowseDialog'.

Rogério Mauri

(www.licitec.com.br - Brazil)
Post #16425
Add to Twitter Add to Facebook
 Posted 5/17/2008 11:34:30 AM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 5/21/2019 3:58:03 AM
Posts: 210, Visits: 641
I found the cause of the error.

'MicroFour.Strataframe.Data.ObjectConverter.ConvertValue(ByVal InputValue As Object, ByVal OutputType As Type)'.

The explicit conversion of ' string ' for ' byte ' is not codified.

TongueTongueTongue

Rogério Mauri

(www.licitec.com.br - Brazil)
Post #16426
Add to Twitter Add to Facebook
 Posted 5/17/2008 11:38:19 AM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 5/21/2019 3:58:03 AM
Posts: 210, Visits: 641
Ops...

Rogerio Mauri (05/17/2008)
The explicit conversion of ' string ' for ' byte ' is not codified.

'string' to 'byte'

Rogério Mauri

(www.licitec.com.br - Brazil)
Post #16427
Add to Twitter Add to Facebook
 Posted 5/19/2008 2:30:48 AM
StrataFrame Developer

StrataFrame DeveloperStrataFrame DeveloperStrataFrame DeveloperStrataFrame DeveloperStrataFrame DeveloperStrataFrame DeveloperStrataFrame DeveloperStrataFrame DeveloperStrataFrame Developer

Group: StrataFrame Developers
Last Login: 11/20/2019 8:57:25 AM
Posts: 6,610, Visits: 6,776
I will put this on the list to look at versus making a wholesale change...I think that there are going to be some downstream consequences by changing just this one thing...I think that the browse will need to take this into account as well.
Post #16436
Add to Twitter Add to Facebook
 Posted 3/11/2014 6:10:32 AM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 11/7/2018 2:37:04 AM
Posts: 193, Visits: 9,066
Hi Trent,

I'm facing the same error today...

InvalidOperationException
  The input value could not be converted to the output type.
ArgumentException
  A value of type 'System.String' cannot be converted to type 'System.Byte'

Source     : MicroFour StrataFrame Base

Stack Trace:

   à MicroFour.StrataFrame.Data.ObjectConverter.ConvertValue(Object InputValue, Type InputType, Type OutputType, String FormatString)

   à MicroFour.StrataFrame.Data.ObjectConverter.ConvertValue(Object InputValue, Type OutputType)
   à MicroFour.StrataFrame.UI.Windows.Forms.ListControl.PopulateComboFromBusinessObject(IListControl lstControl, Object[] Parameters)
   à MicroFour.StrataFrame.UI.Windows.Forms.ListControl.PopulateCombo(Control lstControl, Object[] Parameters)
   à MicroFour.StrataFrame.UI.Windows.Forms.ComboBox.PopulateCombo(Object[] Parameters)
   à MicroFour.StrataFrame.UI.Windows.Forms.ComboBox.Requery()
   à MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialogwindow.CreateBOCombo(SearchFieldItem Item)
   à MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialogwindow.CreateAllSearchFieldControls()
   à MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialogwindow.AddSearchFields()
   à MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialogwindow..ctor(BrowseDialog browse, Boolean PopulateOnShow)
   à MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialog.ShowDialog(Boolean PopulateOnShow, IWin32Window ResultsWindowOwner)
   à MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialog.ShowDialog(Boolean PopulateOnShow)
   à MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialog.ShowDialog()
   à MicroFour.StrataFrame.UI.Windows.Forms.MaintenanceFormToolStrip.cmdBrowse_Click(Object sender, EventArgs e)
   à System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   à System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   à System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   à System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   à System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   à System.Windows.Forms.Control.WndProc(Message& m)
   à System.Windows.Forms.ToolStrip.WndProc(Message& m)
   à System.Windows.Forms.Control.ControlNativewindow.WndProc(Message& m)
   à System.Windows.Forms.Nativewindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


What sould be the best workaround?

I can modifiy my datatype to SmallInt because the data are not in production, but if I could do something on my VB code, I prefer.

Thanks

(SF version 1.7.6)


Tags:
Post #32497
Add to Twitter Add to Facebook


Similar Topics

Expand / Collapse

Reading This Topic

Expand / Collapse

Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.