473,411 Members | 2,030 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

GUID Question

I have a value that was a GUID converted to string and stored in the DB. I
need to get that value back into a Guid, how can i do that? Do something
like (System.Guid)<GUIDStringVariable> does not work. Thanks.

DOug
Nov 16 '05 #1
6 1421
Can help you, but I am intriged to know why you want to do that.
Nov 16 '05 #2

"Doug" <dk*******@hotmail.com> wrote in message news:eC**************@TK2MSFTNGP11.phx.gbl...
I have a value that was a GUID converted to string and stored in the DB. I
need to get that value back into a Guid, how can i do that? Do something
like (System.Guid)<GUIDStringVariable> does not work. Thanks.

DOug


There is a constructor for Guid that accepts a string-parameter.
A different solution could be to directly store the guid
(datatype uniqueidentifier in sqlserver)

Hans Kesting
Nov 16 '05 #3
new Guid(GUIDStringVariable);

Yanick
Doug wrote:
I have a value that was a GUID converted to string and stored in the DB. I
need to get that value back into a Guid, how can i do that? Do something
like (System.Guid)<GUIDStringVariable> does not work. Thanks.

DOug

Nov 16 '05 #4
I knew it was simple - have to stop working so early in the morning; my mind
doesn't work. Thanks.
"Yanick Beaudet" <ya************@centaurnet.co.uk> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
new Guid(GUIDStringVariable);

Yanick
Doug wrote:
I have a value that was a GUID converted to string and stored in the DB.
I need to get that value back into a Guid, how can i do that? Do
something like (System.Guid)<GUIDStringVariable> does not work. Thanks.

DOug

Nov 16 '05 #5
Hans,

Ya I know - the table that I'm using the original developer created it as a
string (his code populated the GUID as a string). So sql srvr can't convert
it back to GUID once it's a string unless the table is empty. Which then
means that i won't be able to convert the id back, etc....you get the point.
Thanks.

"Hans Kesting" <ne***********@spamgourmet.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...

"Doug" <dk*******@hotmail.com> wrote in message
news:eC**************@TK2MSFTNGP11.phx.gbl...
I have a value that was a GUID converted to string and stored in the DB.
I
need to get that value back into a Guid, how can i do that? Do something
like (System.Guid)<GUIDStringVariable> does not work. Thanks.

DOug


There is a constructor for Guid that accepts a string-parameter.
A different solution could be to directly store the guid
(datatype uniqueidentifier in sqlserver)

Hans Kesting

Nov 16 '05 #6
Josh,

See my streams to the others...
"Josh" <so*****@microsoft.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Can help you, but I am intriged to know why you want to do that.

Nov 16 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

24
by: Ilija_G | last post by:
Hi, Is there any replace for "Select @@identity" that could return "just inserted" GUID as a primary key? Has anyone tested what's faster, working with Guid or Autonumber ?
4
by: Louis Frolio | last post by:
Greetings All, I have read many upon many articles here regarding GUID data types and uniqueness. There have been many opinions regarding the effectiveness of GUID's and when they should/should...
1
by: rh | last post by:
Hi I have some problem with GUID when I debug this lin myguid=Guid.NewGuid(); I found some value in watch. System.ValueType = _a = -78434454 _b ,_c,_d ... to _k with specific value After...
3
by: ME | last post by:
I am developing a kind of plugin framework that I can use for several applications I want to make. In order to identify individual plugins I am currently doing something like the code below...
7
by: headware | last post by:
Is the GUID generated by the .NET System.Guid.NewGuid() function compatible with Access' Replication ID field type? Dave
10
by: www.dir | last post by:
Hi, The following is from MSDN. "A GUID is a 128-bit integer (16 bytes) that can be used across all computers and networks wherever a unique identifier is required. Such an identifier has a...
26
by: John Grandy | last post by:
Is it possible to generate a 20 byte integer from a GUID that is "unique enough" ( just like a GUID is not truly unique , but is "unique enough" ). We identify transactions with GUIDs , but a...
2
by: Sky | last post by:
Hello, The books on C# I have read talk of using the DataSets in disconnected mode, and Adding/Removing/Updating records from it, and letting it handle all the updating on the Database in one...
5
by: stjulian | last post by:
IN IIS 6.0, classic .asp I have been creating new GUID's through this block of code set typ = server.createobject("Scriptlet.TypeLib") guid = TRIM(MID(cstr(typ.GUID),2,36))...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.