﻿<?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 » Issues  » Conversion from type 'Guid' to type 'String' is not valid.</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 02:51:42 GMT</lastBuildDate><ttl>20</ttl><item><title>Conversion from type 'Guid' to type 'String' is not valid.</title><link>http://forum.strataframe.net/FindPost26948.aspx</link><description>Hi guys,&lt;br&gt;
&lt;br&gt;
I can't figure this one out.  But this started after I updated to latest beta, I started getting this problem on my development machine.  I noticed that it wasn't happening on the testing server, but then I discovered that I wasn't copying the latest staraframe dll's to the server (so it was still using the old version). The issue is as follows:&lt;br&gt;
&lt;br&gt;
I have a table with a GUID primary key.&lt;br&gt;
&lt;br&gt;
Then I call any of the following:&lt;br&gt;
[codesnippet]&lt;br&gt;
Me.UCPlansBO.Sort = "pl_NumberOfPmts DESC"&lt;br&gt;
[/codesnippet]&lt;br&gt;
&lt;br&gt;
OR&lt;br&gt;
&lt;br&gt;
[codesnippet]&lt;br&gt;
Line 197:                        If Me.MyPlansBO.SeekToPrimaryKey(Me.MyPlanMembersBO.pm_Pl_Key) Then&lt;br&gt;
[/codesnippet]&lt;br&gt;
&lt;br&gt;
It throws the following error:&lt;br&gt;
[quote]&lt;br&gt;
Exception Details: System.InvalidCastException: Conversion from type 'Guid' to type 'String' is not valid.&lt;br&gt;
[/quote]&lt;br&gt;
&lt;br&gt;
The partial stack trace is as follows:&lt;br&gt;
[quote]&lt;br&gt;
[InvalidCastException: Conversion from type 'Guid' to type 'String' is not valid.]&lt;br&gt;
   Microsoft.VisualBasic.CompilerServices.Conversions.ToString(Object Value) +453096&lt;br&gt;
   MicroFour.StrataFrame.Business.BusinessLayer.GetIndexOfPrimaryKey(Object[] PrimaryKeyValues) +233&lt;br&gt;
   MicroFour.StrataFrame.Business.BusinessLayer.SeekToPrimaryKey(Object[] PrimaryKeyValues) +15&lt;br&gt;
   AESWebAccess.EnrollmentWizard.SubmitPlanInfo() in E:\_VS2008Projects\DEV\AES\New_AESWebAccess\AESWebAccess\MyAccount\Applications\EnrollmentWizard.PlanDetail.vb:197&lt;br&gt;
&lt;br&gt;
[/quote]&lt;br&gt;
&lt;br&gt;
I reverted to the previous build and it worked again. Am I doing something screwy though, or is it a bug (or both?:P)&lt;br&gt;
&lt;br&gt;
Marcel</description><pubDate>Wed, 01 Sep 2010 20:57:27 GMT</pubDate><dc:creator>Marcel Heitlager</dc:creator></item><item><title>RE: Conversion from type 'Guid' to type 'String' is not valid.</title><link>http://forum.strataframe.net/FindPost28228.aspx</link><description>Hi,&lt;/P&gt;&lt;P&gt;The problem identified above isn't fixed in 1.7.3.1&lt;/P&gt;&lt;P&gt;Cheers, Peter</description><pubDate>Wed, 01 Sep 2010 20:57:27 GMT</pubDate><dc:creator>Peter Jones</dc:creator></item><item><title>RE: Conversion from type 'Guid' to type 'String' is not valid.</title><link>http://forum.strataframe.net/FindPost28133.aspx</link><description>Actually we had two threads going on this one.  This was actually fixed and is in the build.  It was fixed back in March, so if you weren't running the beta build you may not have noticed this.  At any rate, it is fixed and in the 1.7.3 build.&lt;br&gt;
&lt;br&gt;
[url=http://forum.strataframe.net/Topic26310-10-1.aspx]http://forum.strataframe.net/Topic26310-10-1.aspx[/url]</description><pubDate>Sat, 28 Aug 2010 09:21:11 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Conversion from type 'Guid' to type 'String' is not valid.</title><link>http://forum.strataframe.net/FindPost27230.aspx</link><description>Thanks Peter! This one was missed, but is now in the list of issues we'll take a look at it this week and post as soon as the fix is done.</description><pubDate>Tue, 25 May 2010 11:23:34 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Conversion from type 'Guid' to type 'String' is not valid.</title><link>http://forum.strataframe.net/FindPost27224.aspx</link><description>Hi Guys,&lt;br&gt;
&lt;br&gt;
I just wanted to reactivate this post to make sure it has been seen and the appropriate action taken in the next SF release.&lt;br&gt;
&lt;br&gt;
Cheers, Peter</description><pubDate>Mon, 24 May 2010 18:18:59 GMT</pubDate><dc:creator>Peter Jones</dc:creator></item><item><title>RE: Conversion from type 'Guid' to type 'String' is not valid.</title><link>http://forum.strataframe.net/FindPost27092.aspx</link><description>Hi Guys,&lt;br&gt;
&lt;br&gt;
The problem is in businesslayer.vb in the function GetIndexOfPrimaryKey on lines 2845 to 2850, and relates to the change to resolve the issue of a primary key containing a singlequote.&lt;br&gt;
&lt;br&gt;
The code prior to the change used PrimaryKeyValues(lnCnt).ToString() to get the value of that portion of the key&lt;br&gt;
&lt;br&gt;
The changed code uses CStr(PrimaryKeyValues(lnCnt)).Replace("'", "''") to get the portion of the key and address the issue of single quotes. The problem with this is that CStr doesn't work on a Guid.&lt;br&gt;
&lt;br&gt;
An alternative using PrimaryKeyValues(lnCnt).ToString.Replace("'", "''") appears to fix the issue.&lt;br&gt;
&lt;br&gt;
Cheers, Peter</description><pubDate>Wed, 05 May 2010 17:31:24 GMT</pubDate><dc:creator>Peter Jones</dc:creator></item><item><title>RE: Conversion from type 'Guid' to type 'String' is not valid.</title><link>http://forum.strataframe.net/FindPost27085.aspx</link><description>Hi Guys,&lt;br&gt;
&lt;br&gt;
Bump de Bump....&lt;br&gt;
&lt;br&gt;
We are seeing the same issue (all our PK's are GUIDs) and are rolling out a VS2010 version this weekend. We will be looking to change the SF code to get us going so any assistance you could give in terms of what we could/should change would be appreciated.&lt;br&gt;
&lt;br&gt;
Cheers, Peter</description><pubDate>Wed, 05 May 2010 07:44:49 GMT</pubDate><dc:creator>Peter Jones</dc:creator></item><item><title>RE: Conversion from type 'Guid' to type 'String' is not valid.</title><link>http://forum.strataframe.net/FindPost26987.aspx</link><description>Well, I reverted back to the previous update.  Rebooted the machine.  And now it works again.  I'll try again updating later to try to figure out what's going on.&lt;br&gt;
&lt;br&gt;</description><pubDate>Fri, 23 Apr 2010 10:23:17 GMT</pubDate><dc:creator>Marcel Heitlager</dc:creator></item></channel></rss>