﻿<?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?)  » BrowseDialog with Foreign Keys GUID type...</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 18:25:30 GMT</lastBuildDate><ttl>20</ttl><item><title>BrowseDialog with Foreign Keys GUID type...</title><link>http://forum.strataframe.net/FindPost4384.aspx</link><description>&lt;FONT color=#5555bb&gt;I have a table with a child table which are linked to by a foreign key field in the parent, to the primary key field in the child table.&amp;nbsp; While testing this on a test DB, using the ForeignKey ComboBox it worked perfectly, using integer type fields.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#5555bb&gt;Now trying to use this same approach on my production data using GUID type PK's and FK's, the Function ConvertValue in the ObjectConverter is throwing an error, saying that "&lt;FONT size=2&gt;&lt;FONT color=#ff1111&gt;The input value could not be converted to the output type&lt;/FONT&gt;."&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#5555bb size=2&gt;I looked through this code, and there doesn't seem to be an If statement for a GUID type.&amp;nbsp; Is this something that is just impossible at this time, or not doable all together, or am I just going about this the wrong way?&lt;BR&gt;&lt;BR&gt;Thanks,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#5555bb&gt;Robin Giltner&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#800000 size=2&gt;&lt;/FONT&gt;&amp;nbsp;</description><pubDate>Tue, 14 Nov 2006 13:53:15 GMT</pubDate><dc:creator>Robin J Giltner</dc:creator></item><item><title>RE: BrowseDialog with Foreign Keys GUID type...</title><link>http://forum.strataframe.net/FindPost4434.aspx</link><description>Thanks for the list, Robin :)&amp;nbsp; Say hi to the rest of the guys for me.</description><pubDate>Tue, 14 Nov 2006 13:53:15 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: BrowseDialog with Foreign Keys GUID type...</title><link>http://forum.strataframe.net/FindPost4428.aspx</link><description>Absolutely.&amp;nbsp; They will be to you shortly.&amp;nbsp; The only other change I found I had to tinker with, was the "Clear" button on the browsedialog.&amp;nbsp; The Strataframe source had set the SelectedValue to -1, to I just changed that to SelectedIndex = 0.&lt;/P&gt;&lt;P&gt;Pressing the Clear fields would clear out the value of the combobox and would return no results unless I changed it to "&amp;lt;Not Used&amp;gt;"&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Robin Giltner</description><pubDate>Tue, 14 Nov 2006 12:56:09 GMT</pubDate><dc:creator>Robin J Giltner</dc:creator></item><item><title>RE: BrowseDialog with Foreign Keys GUID type...</title><link>http://forum.strataframe.net/FindPost4407.aspx</link><description>Not that I can think of off the top of my head.&amp;nbsp; Would you mind emailing me a complete list of the changes you had to make so that we can implement them for future versions... so you don't have to make the same changes the next time we release a new source code version...</description><pubDate>Tue, 14 Nov 2006 08:37:03 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: BrowseDialog with Foreign Keys GUID type...</title><link>http://forum.strataframe.net/FindPost4395.aspx</link><description>Hey Ben.&amp;nbsp; I added the code into the ObjectConverter to check for a "-1" then return an empty GUID, else return the good from the InputValue.&amp;nbsp; I also had to end up in the BrowseDialogWindow class, adding support for a GUID in the HasData function, and adding the GUID type to the BuildWhereElement Function.&amp;nbsp; My form seems to be working now best I can tell.&lt;/P&gt;&lt;P&gt;Can you think of any other places that I haven't gotten to yet that are going to throw a wrench into this?&lt;BR&gt;&lt;BR&gt;Thanks,&lt;/P&gt;&lt;P&gt;Robin Giltner</description><pubDate>Mon, 13 Nov 2006 13:35:55 GMT</pubDate><dc:creator>Robin J Giltner</dc:creator></item><item><title>RE: BrowseDialog with Foreign Keys GUID type...</title><link>http://forum.strataframe.net/FindPost4393.aspx</link><description>Yes, the -1 is for the "Not Used".&amp;nbsp; However, you should be able to specify something other than -1 for the top most value.&amp;nbsp; Something like 00000000-0000-0000-0000-000000000000 should parse back into a guid.&amp;nbsp; Or you could add another If test to the ConvertValue method so that it returns New Guid("00000000-0000-0000-0000-000000000000") if the InputValue equals "-1".&amp;nbsp; Either way should work for you.</description><pubDate>Mon, 13 Nov 2006 12:46:01 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: BrowseDialog with Foreign Keys GUID type...</title><link>http://forum.strataframe.net/FindPost4392.aspx</link><description>Well that fixed the If/IfElse in the ConvertValue function, but I seem to have another problem with this, it keeps bombing trying to Convert the string value "-1" to type Guid.&amp;nbsp; The ex.Message says &lt;/P&gt;&lt;P&gt;"&lt;FONT size=2&gt;Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)."&amp;nbsp;&amp;nbsp; I'm guessing the -1 is for the "Not Used" value in the combo box.&amp;nbsp; So it is dieing trying to convert the string "-1" to a GUID type ?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;Thanks,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;Robin Giltner&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Mon, 13 Nov 2006 12:38:34 GMT</pubDate><dc:creator>Robin J Giltner</dc:creator></item><item><title>RE: BrowseDialog with Foreign Keys GUID type...</title><link>http://forum.strataframe.net/FindPost4387.aspx</link><description>Not a problem... you are most certainly correct... I included all of the basic value types in the ConvertValue method, but for some reason, I just left the Guid type off.&amp;nbsp; Sorry for the trouble.</description><pubDate>Mon, 13 Nov 2006 09:59:10 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: BrowseDialog with Foreign Keys GUID type...</title><link>http://forum.strataframe.net/FindPost4386.aspx</link><description>Awesome, thanks Ben.&lt;/P&gt;&lt;P&gt;I have pretty much done that to get it to work, but getting the official nod always makes me feel better when I'm chaning StrataFrame Source.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;BR&gt;Robin Giltner</description><pubDate>Mon, 13 Nov 2006 09:57:27 GMT</pubDate><dc:creator>Robin J Giltner</dc:creator></item><item><title>RE: BrowseDialog with Foreign Keys GUID type...</title><link>http://forum.strataframe.net/FindPost4385.aspx</link><description>For some reason, it looks like the Guid type was omitted from the ConvertValue of the object converter.&amp;nbsp; If you are compiling your source code, then you can add the following code to the bottom of the the convert method, right before the last End If.&amp;nbsp; If you aren't compiling the source code, the change will be included in the next build.&lt;/P&gt;&lt;FONT size=1&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;ElseIf&lt;/FONT&gt;&lt;FONT size=1&gt; OutputType &lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;Is&lt;/FONT&gt;&lt;FONT size=1&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;GetType&lt;/FONT&gt;&lt;FONT size=1&gt;(Guid) &lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;Then&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT color=#008000 size=1&gt;'-- We need to parse the input value&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;If&lt;/FONT&gt;&lt;FONT size=1&gt; InputType &lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;Is&lt;/FONT&gt;&lt;FONT size=1&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;GetType&lt;/FONT&gt;&lt;FONT size=1&gt;(&lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;String&lt;/FONT&gt;&lt;FONT size=1&gt;) &lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;Then&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;Return&lt;/FONT&gt;&lt;FONT size=1&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;New&lt;/FONT&gt;&lt;FONT size=1&gt; Guid(&lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;CType&lt;/FONT&gt;&lt;FONT size=1&gt;(InputValue, &lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;String&lt;/FONT&gt;&lt;FONT size=1&gt;))&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;End&lt;/FONT&gt;&lt;FONT size=1&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;If&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Mon, 13 Nov 2006 09:55:26 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item></channel></rss>