468,249 Members | 1,497 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,249 developers. It's quick & easy.

GUID and uniqueidentifier

Hi,

I do have one dataset from SQL server with a field
(bound) to Textbox called txtID , this field is of type
uniqueidentifier.

From the doc, they say the equivalent is GUID in dot net,

UniqueIdentifier = Supported by the .NET Compact
Framework. =
Guid = A globally unique identifier (or GUID).

Now, when that field is display into the form, I can see
the actual value without any issue.

My trouble is how can I pas it back to one function to be
use for update.

I try to cast it to GUID with the following syntax,
(System.Guid)txtID.Text

But receive the error Cannot convert type 'string'
to 'System.Guid'

So, how do I convert this txtID Textbox into GUID or
uniqueidentifier ?

Carl,

Nov 15 '05 #1
2 23340
Instead of using a cast, call the Guid constructor, e.g.

Guid g = new Guid(txtID.text)
"Carl" <ca**@cb-cinc.com> wrote in message
news:05****************************@phx.gbl...
Hi,

I do have one dataset from SQL server with a field
(bound) to Textbox called txtID , this field is of type
uniqueidentifier.

From the doc, they say the equivalent is GUID in dot net,

UniqueIdentifier = Supported by the .NET Compact
Framework. =
Guid = A globally unique identifier (or GUID).

Now, when that field is display into the form, I can see
the actual value without any issue.

My trouble is how can I pas it back to one function to be
use for update.

I try to cast it to GUID with the following syntax,
(System.Guid)txtID.Text

But receive the error Cannot convert type 'string'
to 'System.Guid'

So, how do I convert this txtID Textbox into GUID or
uniqueidentifier ?

Carl,

Nov 15 '05 #2
Thanks,

I forgot this one... :(

Carl,
-----Original Message-----
Instead of using a cast, call the Guid constructor, e.g.

Guid g = new Guid(txtID.text)
"Carl" <ca**@cb-cinc.com> wrote in message
news:05****************************@phx.gbl...
Hi,

I do have one dataset from SQL server with a field
(bound) to Textbox called txtID , this field is of type
uniqueidentifier.

From the doc, they say the equivalent is GUID in dot net,
UniqueIdentifier = Supported by the .NET Compact
Framework. =
Guid = A globally unique identifier (or GUID).

Now, when that field is display into the form, I can see the actual value without any issue.

My trouble is how can I pas it back to one function to be use for update.

I try to cast it to GUID with the following syntax,
(System.Guid)txtID.Text

But receive the error Cannot convert type 'string'
to 'System.Guid'

So, how do I convert this txtID Textbox into GUID or
uniqueidentifier ?

Carl,

.

Nov 15 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

24 posts views Thread by Ilija_G | last post: by
4 posts views Thread by Jacques Wentworth | last post: by
3 posts views Thread by Jeffry van de Vuurst | last post: by
3 posts views Thread by SMG | last post: by
1 post views Thread by Scott M. Lyon | last post: by
1 post views Thread by Scott M. Lyon | last post: by
reply views Thread by kermitthefrogpy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.