Expression Shape - Converting GUID to string variable in one line/
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > BizTalk Server > BizTalk Server Orchestration > Expression Shape - Converting GUID to string variable in one line/




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Expression Shape - Converting GUID to string variable in one line/  
Neal Walters


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-28-04 01:14 PM


I'd like to convert a GUID to a string on one line of code instead of two.

//Biztalk does not like either of these two lines of code
// which work fine in C# (vStrGUID is a string variable)
// Says "illegal dotted name" on the Guid().ToString
// and says "an object ref is required for a non-static field

//vStrGUID = System.Guid.NewGuid().ToString();
//vStrGUID = (System.Guid.NewGuid()).ToString();

// This works fine (so far)
vGUID = System.Guid.NewGuid();
vStrGUID = vGUID.ToString();

Is this one of those cases where XLangS is just different than C#???

Thanks in advance,
Neal Walters
http://Biztalk-Training.com - Biztalk 2004 Training Videos






[ Post a follow-up to this message ]



    RE: Expression Shape - Converting GUID to string variable in one line/  
Alan Smith


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-28-04 10:52 PM

Hi Neal,

Try this:

vStrGUID = System.String.Format ("{0}", System.Guid.NewGuid ());

I often find I have to jump through a few hoops to get XLANG/s to do
something.

It would be good to see some examples of "Best Practices" and code examples.

Regards,

Alan


"Neal Walters" wrote:

>
> I'd like to convert a GUID to a string on one line of code instead of two.
>
> //Biztalk does not like either of these two lines of code
> // which work fine in C# (vStrGUID is a string variable)
> // Says "illegal dotted name" on the Guid().ToString
> // and says "an object ref is required for a non-static field
>
> //vStrGUID = System.Guid.NewGuid().ToString();
> //vStrGUID = (System.Guid.NewGuid()).ToString();
>
> // This works fine (so far)
> vGUID = System.Guid.NewGuid();
> vStrGUID = vGUID.ToString();
>
> Is this one of those cases where XLangS is just different than C#???
>
> Thanks in advance,
> Neal Walters
> http://Biztalk-Training.com - Biztalk 2004 Training Videos
>





[ Post a follow-up to this message ]



    Re: Expression Shape - Converting GUID to string variable in one line/  
Devdutt Patnaik


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-28-04 10:52 PM

Neal,
System.Convert.ToString(System.Guid.NewGuid());
doesn't give any compilation errors, you might wanna check if it works.
Regards
Dev

"Neal Walters" <NealWalters@discussions.microsoft.com> wrote in message
news:0C371F1F-660C-4FF6-93CE-356AAC36AFED@microsoft.com...
>
> I'd like to convert a GUID to a string on one line of code instead of two.
>
> //Biztalk does not like either of these two lines of code
> // which work fine in C# (vStrGUID is a string variable)
> // Says "illegal dotted name" on the Guid().ToString
> // and says "an object ref is required for a non-static field
>
> //vStrGUID = System.Guid.NewGuid().ToString();
> //vStrGUID = (System.Guid.NewGuid()).ToString();
>
> // This works fine (so far)
> vGUID = System.Guid.NewGuid();
> vStrGUID = vGUID.ToString();
>
> Is this one of those cases where XLangS is just different than C#???
>
> Thanks in advance,
> Neal Walters
> http://Biztalk-Training.com - Biztalk 2004 Training Videos
>







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 12:08 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register