ERROR - BrowseDialog - Search Field Criteria


Author
Message
Rogerio Mauri
Rogerio Mauri
StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)
Group: StrataFrame Users
Posts: 205, Visits: 629
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 Smile



Attachments
StrataFrameError.zip (193 views, 520.00 KB)
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
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.

Rogerio Mauri
Rogerio Mauri
StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)
Group: StrataFrame Users
Posts: 205, Visits: 629
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 Smile



Rogerio Mauri
Rogerio Mauri
StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)
Group: StrataFrame Users
Posts: 205, Visits: 629
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 Smile



Rogerio Mauri
Rogerio Mauri
StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)
Group: StrataFrame Users
Posts: 205, Visits: 629
Ops...

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

'string' to 'byte'

Rogério Mauri Smile



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
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.
Michel Levy
Michel Levy
StrataFrame User (441 reputation)StrataFrame User (441 reputation)StrataFrame User (441 reputation)StrataFrame User (441 reputation)StrataFrame User (441 reputation)StrataFrame User (441 reputation)StrataFrame User (441 reputation)StrataFrame User (441 reputation)StrataFrame User (441 reputation)
Group: StrataFrame Users
Posts: 193, Visits: 9K
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)
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