Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use System.Guid.Parse in framework 3.5

I was building my BLL with the .Net Framework 4.0 but then I noticed I needed it for a WebServices app, so I changed the .Net version to 3.5. Now I have this line of code giving me an error:

tmp.GlobalIdentifier = Guid.Parse(Convert.ToString(row["GlobalIdentifier"]));

The error is

'System.Guid' does not contain a definition for 'Parse'

which is a very clear error. Do you have any equivalent "Parse" method in any other class? What would be the best way to parse a SQL Server UniqueIdentifier into a System.Guid object using .Net framework 3.5?

like image 218
Hanlet Escaño Avatar asked Sep 20 '11 14:09

Hanlet Escaño


1 Answers

try tmp.GlobalIdentifier = new Guid(Convert.ToString(row["GlobalIdentifier"]))

Linking MSDN documentation.

like image 108
Icarus Avatar answered Sep 20 '22 23:09

Icarus