473,327 Members | 1,936 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,327 software developers and data experts.

Cast String to Guid

Yog
How do i convert a string to a Guid datatype
Jul 21 '05 #1
6 46994
System.Guid g = new Guid("f72941f4-57fa-46db-89ba-df4a17277b05");

"Yog" <an*******@discussions.microsoft.com> wrote in message
news:1c****************************@phx.gbl...
How do i convert a string to a Guid datatype

Jul 21 '05 #2
Hello use the Guid constructor...

Guid g = new Guid(string) ;

..Sacha

"Yog" <an*******@discussions.microsoft.com> a écrit dans le message de
news:1c****************************@phx.gbl...
How do i convert a string to a Guid datatype

Jul 21 '05 #3
Guid guid = new Guid(myString);

If the string is in an incorrect format, it will blow up, of course.

---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************

"Yog" wrote:
How do i convert a string to a Guid datatype

Jul 21 '05 #4
Hi Yog,

Guid g = new Guid(string);
On Thu, 4 Nov 2004 07:30:20 -0800, Yog
<an*******@discussions.microsoft.com> wrote:
How do i convert a string to a Guid datatype


--
Happy Coding!
Morten Wennevik [C# MVP]
Jul 21 '05 #5
Yog
Thanks guys, i was passing an invalid string. Thank you
for the help.
Jul 21 '05 #6
How to get the GUID string of the OS/Machine? And can you use this
resulting string in this constructor? TIA

--
William Stacey, MVP
http://mvp.support.microsoft.com

"Antony Baula" <an*********@makova.ru> wrote in message
news:cm***********@antigua.mtu.ru...
System.Guid g = new Guid("f72941f4-57fa-46db-89ba-df4a17277b05");

"Yog" <an*******@discussions.microsoft.com> wrote in message
news:1c****************************@phx.gbl...
How do i convert a string to a Guid datatype



Jul 21 '05 #7

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

Similar topics

2
by: mp | last post by:
How do i cast a string from sql to a long? lDocumentVersion is long, oSqlDR.GetValue(0) returns a string. lDocumentVersion =oSqlDR.GetValue(0); Thanks
8
by: Paul | last post by:
I am new to C#, but have c experience. Anyhow I have a web application and am just trying to get the selected value of a dropdown box in integer form so I can pass it to a stored procedure, but...
3
by: dbuchanan | last post by:
How do I explicitly cast a string to Byte? Here are my circumstances; The string is from a textbox and could be empty. The Byte is a tinyint in SQL Server 2000 I am using the AddRow method as...
6
by: Yog | last post by:
How do i convert a string to a Guid datatype
13
by: archuleta37 | last post by:
I'm trying to cast a String from a web forms textbox into an Int16 (see code below), but it's not quite working. When I post the textbox with numbers (no alpha chars) I get the following error in...
2
by: elena | last post by:
Hi, All Please, i need help with cast string to DateTime: DateTime dt = new DateTime(2006,09,17); it works i can update Field in Access DB Next field is Short Time data type, how i can cast...
1
by: =?Utf-8?B?U2lzbmF6?= | last post by:
I'm having a very strange problem I can't seem to figure out and am hoping maybe somebody has seen it before. I get an exception "Cast string to date is invalid" with this chunk of code: '...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.