Conversion from type 'Guid' to type 'String' is not valid.


Author
Message
Marcel Heitlager
Marcel Heitlager
StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)
Group: StrataFrame Users
Posts: 84, Visits: 835
Hi guys,



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:



I have a table with a GUID primary key.



Then I call any of the following:



Me.UCPlansBO.Sort = "pl_NumberOfPmts DESC"





OR





Line 197: If Me.MyPlansBO.SeekToPrimaryKey(Me.MyPlanMembersBO.pm_Pl_Key) Then





It throws the following error:



Exception Details: System.InvalidCastException: Conversion from type 'Guid' to type 'String' is not valid.





The partial stack trace is as follows:



[InvalidCastException: Conversion from type 'Guid' to type 'String' is not valid.]

Microsoft.VisualBasic.CompilerServices.Conversions.ToString(Object Value) +453096

MicroFour.StrataFrame.Business.BusinessLayer.GetIndexOfPrimaryKey(Object[] PrimaryKeyValues) +233

MicroFour.StrataFrame.Business.BusinessLayer.SeekToPrimaryKey(Object[] PrimaryKeyValues) +15

AESWebAccess.EnrollmentWizard.SubmitPlanInfo() in E:\_VS2008Projects\DEV\AES\New_AESWebAccess\AESWebAccess\MyAccount\Applications\EnrollmentWizard.PlanDetail.vb:197







I reverted to the previous build and it worked again. Am I doing something screwy though, or is it a bug (or both?Tongue)



Marcel
Marcel Heitlager
Marcel Heitlager
StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)
Group: StrataFrame Users
Posts: 84, Visits: 835
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.



Peter Jones
Peter Jones
Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)
Group: Forum Members
Posts: 386, Visits: 2.1K
Hi Guys,



Bump de Bump....



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.



Cheers, Peter
Peter Jones
Peter Jones
Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)
Group: Forum Members
Posts: 386, Visits: 2.1K
Hi Guys,



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.



The code prior to the change used PrimaryKeyValues(lnCnt).ToString() to get the value of that portion of the key



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.



An alternative using PrimaryKeyValues(lnCnt).ToString.Replace("'", "''") appears to fix the issue.



Cheers, Peter
Peter Jones
Peter Jones
Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)
Group: Forum Members
Posts: 386, Visits: 2.1K
Hi Guys,



I just wanted to reactivate this post to make sure it has been seen and the appropriate action taken in the next SF release.



Cheers, Peter
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.5K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
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.
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
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.



http://forum.strataframe.net/Topic26310-10-1.aspx
Peter Jones
Peter Jones
Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)
Group: Forum Members
Posts: 386, Visits: 2.1K
Hi,

The problem identified above isn't fixed in 1.7.3.1

Cheers, Peter

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