﻿<?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 / WinForms (How do I?)  / a simple combobox / Latest Posts</title><generator>InstantForum.NET v4.1.4</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>forum@strataframe.net</webMaster><lastBuildDate>Tue, 02 Dec 2008 15:51:23 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: a simple combobox</title><link>http://forum.strataframe.net/Topic17176-7-1.aspx</link><description>Thank you tremeThank you tremendously anyway, because it allows me to advancendously anyway, because it allows me to advance&lt;/P&gt;&lt;P&gt;best regards&lt;/P&gt;&lt;P&gt;Eric</description><pubDate>Thu, 19 Jun 2008 13:26:35 GMT</pubDate><dc:creator>Eric Leissler</dc:creator></item><item><title>RE: a simple combobox</title><link>http://forum.strataframe.net/Topic17176-7-1.aspx</link><description>Hi Eric,&lt;/P&gt;&lt;P&gt;I am glad it worked for you. :)&lt;/P&gt;&lt;P&gt;Also the forum's search feature is pretty good and you can do searches to find specific topics which may give you an answer quickly.  Since I am also learning SF, I use the forums all the time and they are a great, great resouces.</description><pubDate>Thu, 19 Jun 2008 11:32:12 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: a simple combobox</title><link>http://forum.strataframe.net/Topic17176-7-1.aspx</link><description>Hi Edhy &lt;/P&gt;&lt;P&gt;Its really great  !&lt;/P&gt;&lt;P&gt;Thanks you very much &lt;/P&gt;&lt;P&gt;I made this changement and its ok  now . &lt;/P&gt;&lt;P&gt;I can continue my learning of strataframe. &lt;/P&gt;&lt;P&gt;Great thanks &lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Eric</description><pubDate>Thu, 19 Jun 2008 11:24:02 GMT</pubDate><dc:creator>Eric Leissler</dc:creator></item><item><title>RE: a simple combobox</title><link>http://forum.strataframe.net/Topic17176-7-1.aspx</link><description>Hi Eric and welcome to the forums. &lt;P&gt;[quote]&lt;/P&gt;&lt;P&gt;So in my form i have  acteursBO1  and  TitresBO1&lt;/P&gt;&lt;P&gt;in the property of titresbo1 i have  ParentbusinnesObject  = ActeursBo1&lt;/P&gt;&lt;P&gt;So i drop a  strataframe combobox in my form &lt;/P&gt;&lt;P&gt;on property  i go to Businnesobject and i select Acteursbo1&lt;/P&gt;&lt;P&gt;In bindingfields i select titre_id&lt;/P&gt;&lt;P&gt;in the property Plulatiopndatasourcesettings  i select in busines obect type titresbo&lt;/P&gt;&lt;P&gt;in display member i select abrege and in value number i select identifiant&lt;/P&gt;&lt;P&gt;When i execute i have an error  at the line &lt;/P&gt;&lt;P&gt;ctype(component,acteursbo).titre_id = ctupe(value,system.int32)&lt;/P&gt;&lt;P&gt;the error is the conversion of type  dbnull  in type integer is not valid [/quote]&lt;/P&gt;&lt;P&gt;Here are some things I see in your code:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;You don't need to have the TitresBO1 in the form, since the combobox class will use an internal BO to show the lookup data and there will be no need to update the ParentBusinessObject since this BO is not needed in the form.&lt;/LI&gt;&lt;LI&gt;In the TitresBO.vb class, modify the code and add a method that will return you all the records for that table and use that method in your ComboBox.PopulationDataSourceSettings property.  Here is an example of what I use in these cases:&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;[codesnippet]&lt;FONT color=#0000ff size=2&gt;&lt;/P&gt;&lt;P&gt;#Region&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;" Data Retrieval Methods "&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;     ''' &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;&amp;lt;summary&amp;gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;     ''' This method will return all records from the table InsuredCorporation&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;     ''' &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;&amp;lt;/summary&amp;gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;     ''' &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;&amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#008000&gt;     &lt;/FONT&gt;Public&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Sub&lt;/FONT&gt;&lt;FONT size=2&gt; FillAllRecords()&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#008000&gt;          &lt;/FONT&gt;Using&lt;/FONT&gt;&lt;FONT size=2&gt; cmd &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;FONT size=2&gt; SqlCommand()&lt;/P&gt;&lt;P&gt;&lt;FONT color=#008000&gt;               &lt;/FONT&gt;cmd.CommandText = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;String&lt;/FONT&gt;&lt;FONT size=2&gt;.Format(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"Select * From {0} ORDER BY CorporationName"&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;FONT size=2&gt;.TableName)&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#008000&gt;               &lt;/FONT&gt;Me&lt;/FONT&gt;&lt;FONT size=2&gt;.FillDataTable(cmd)&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#008000&gt;          &lt;/FONT&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Using&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#008000&gt;     &lt;/FONT&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Sub&lt;/P&gt;&lt;P&gt;#End&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Region&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;[/codesnippet]&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Recompile your TitresBO.vb class so you can see the new method FillAllRecords in the designer Properties windows.&lt;/LI&gt;&lt;LI&gt;Now modify your ComboBox.PopulationDataSourceSettings property to use the new method TitresBO.FillAllRecords().&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Here is a picture of the ComboBox properties:&lt;/P&gt;&lt;P&gt;&lt;IMG src="http://forum.strataframe.net/Uploads/Images/1839fe9e-27ee-4b62-8703-e3fa.png"&gt;&lt;/P&gt;&lt;P&gt;Now, Save, Rebuild and Test....&lt;/P&gt;&lt;P&gt;Good luck!</description><pubDate>Thu, 19 Jun 2008 11:07:38 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>a simple combobox</title><link>http://forum.strataframe.net/Topic17176-7-1.aspx</link><description>Hi ,&lt;/P&gt;&lt;P&gt;Im a french new user of strataframe, so excuse my language fault.&lt;/P&gt;&lt;P&gt;My problem. &lt;/P&gt;&lt;P&gt;I have a form with to businessobject.&lt;/P&gt;&lt;P&gt;The first is  ActeursBO&lt;/P&gt;&lt;P&gt; It contain a table "acteurs" with  identifiant    int     identity and primary key&lt;/P&gt;&lt;P&gt;                                                 name        char(30)&lt;/P&gt;&lt;P&gt;                                                 firstname   char(10)&lt;/P&gt;&lt;P&gt;                                                 titre_id     int &lt;/P&gt;&lt;P&gt;The  data are &lt;/P&gt;&lt;P&gt;    IDENTIFIANT                     NAME                     FIRSTNAME                 TITRE_ID&lt;/P&gt;&lt;P&gt;                   1                        LEISSLER                ERIC                             3&lt;/P&gt;&lt;P&gt;                   2                        LEISSLER                COLETTE                        2&lt;/P&gt;&lt;P&gt;                   3                        LEISSLER                SEREINE                        1&lt;/P&gt;&lt;P&gt;THE second businnes object is &lt;/P&gt;&lt;P&gt;TITREBO&lt;/P&gt;&lt;P&gt;It contain  table   "titre" with   identifiant   int  identity   primarykey&lt;/P&gt;&lt;P&gt;                                             abrege            char(10)&lt;/P&gt;&lt;P&gt;                                             libelle             char(30)&lt;/P&gt;&lt;P&gt;and the data is &lt;/P&gt;&lt;P&gt;IDENTIFIANT               ABREGE                  LIBELLE &lt;/P&gt;&lt;P&gt;        1                          Melle                      Mademoiselle &lt;/P&gt;&lt;P&gt;        2                           Mme                      Madame &lt;/P&gt;&lt;P&gt;        3                           M.                          Monsieur &lt;/P&gt;&lt;P&gt;So in my form i have  acteursBO1  and  TitresBO1&lt;/P&gt;&lt;P&gt;in the property of titresbo1 i have  ParentbusinnesObject  = ActeursBo1&lt;/P&gt;&lt;P&gt;So i drop a  strataframe combobox in my form &lt;/P&gt;&lt;P&gt;on property  i go to Businnesobject and i select Acteursbo1&lt;/P&gt;&lt;P&gt;In bindingfields i select titre_id&lt;/P&gt;&lt;P&gt;in the property Plulatiopndatasourcesettings  i select in busines obect type titresbo&lt;/P&gt;&lt;P&gt;in display member i select abrege and in value number i select identifiant&lt;/P&gt;&lt;P&gt;When i execute i have an error  at the line &lt;/P&gt;&lt;P&gt;ctype(component,acteursbo).titre_id = ctupe(value,system.int32)&lt;/P&gt;&lt;P&gt;the error is the conversion of type  dbnull  in type integer is not valid &lt;/P&gt;&lt;P&gt;What can i do ?&lt;/P&gt;&lt;P&gt;what i have not do ?&lt;/P&gt;&lt;P&gt;what i have to do  ?&lt;/P&gt;&lt;P&gt;i don't find in the example à simple exemple with a simple combobox. &lt;/P&gt;&lt;P&gt;Somebody  can  send an  sample example like this problem ? &lt;/P&gt;&lt;P&gt;I will thank you for the time  you pass'd to read this post&lt;/P&gt;&lt;P&gt;Best regard&lt;/P&gt;&lt;P&gt;Eric LEISSLER&lt;BR&gt;</description><pubDate>Thu, 19 Jun 2008 10:49:07 GMT</pubDate><dc:creator>Eric Leissler</dc:creator></item></channel></rss>