|
-
May 14th, 2004, 02:49 PM
#1
Thread Starter
New Member
passing a GUID in the querystring
I need to pass a GUID into a page via the QueryString. If I do:
VB Code:
Dim myGUID as GUID
GUID = Request.QueryString("myGUID")
It won't run, and says that a value type of string cannot be converted to a GUID. I can't retype myGUID as a string, because I use it in a SQL Server Database call....It yells at me if try to do a query with it in there.
Am I doing something wrong? or is there just no way to pass a GUID through the querystring?
Thanks
-
May 14th, 2004, 02:56 PM
#2
New Member
If you pass the value on the url it will be in a string format. The following worked for me. Maybe this will help.
select * from table1 where uniqueID = cast('{5BEEAA61-394B-44F6-9AC8-A6EA5FC99490}' as uniqueidentifier)
-
May 14th, 2004, 05:46 PM
#3
PowerPoster
You need to do the following:
Code:
Dim MyGuid As Guid = New Guid(Request.QueryString("myGuid"))
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|