C# to VB Conversion
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Microsoft Content Management Server > C# to VB Conversion




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

    C# to VB Conversion  
Mark Mahacek


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


 
08-31-05 01:48 AM

Please let me know right away if I need to go to another newsgroup for this.

We are coding our MCMS site using VB.NET, as that's what we know best.  I
have a book that has some good controls in it, but their code is in C#.
I've been able to convert most of these without a problem, but I'm having
problems with the following snipet:

C# Statement
if(channelItem is Channel)
{ ... }
channelItem is the variable name, and is type ChannelItem.

I tried to convert this to the following in VB:
if channelItem is Channel then
...
end if

However it says that "Channel" is a type and cannot be used as an
expression.

I would go right to a VB or C# group, but this uses MCMS specific object
types

Thanks in advance.

--
Mark Mahacek
Merced County Office of Education








[ Post a follow-up to this message ]



    Re: C# to VB Conversion  
Patrik Berglund


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


 
08-31-05 07:51 AM

Hi!

I'm no expert at VB.NET, but this might work for you:

If TypeOf channelItem Is Channel Then
....
End If

A colleague of mine suggested using a converter such as
http://www.kamalpatel.net/ConvertCSharp2VB.aspx to convert c# to
VB.Net.

/Patrik






[ Post a follow-up to this message ]



    Re: C# to VB Conversion  
Stefan [MSFT]


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


 
08-31-05 12:49 PM

Hi Mark,

see here:
http://blogs.technet.com/stefan_gos.../06/108512.aspx

Cheers,
Stefan

--
This posting is provided "AS IS" with no warranties, and confers no rights

New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
----------------------


"Mark Mahacek" <mmahacek@mcoe.org> wrote in message
news:Ozj6ZmbrFHA.2596@TK2MSFTNGP09.phx.gbl...
> Please let me know right away if I need to go to another newsgroup for
> this.
>
> We are coding our MCMS site using VB.NET, as that's what we know best.  I
> have a book that has some good controls in it, but their code is in C#.
> I've been able to convert most of these without a problem, but I'm having
> problems with the following snipet:
>
> C# Statement
> if(channelItem is Channel)
> { ... }
> channelItem is the variable name, and is type ChannelItem.
>
> I tried to convert this to the following in VB:
> if channelItem is Channel then
> ...
> end if
>
> However it says that "Channel" is a type and cannot be used as an
> expression.
>
> I would go right to a VB or C# group, but this uses MCMS specific object
> types
>
> Thanks in advance.
>
> --
> Mark Mahacek
> Merced County Office of Education
>
>
>







[ Post a follow-up to this message ]



    Re: C# to VB Conversion  
Mark Mahacek


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


 
08-31-05 10:58 PM

To both Patrik and Stefan:

THANK YOU! THANK YOU! THANK YOU!

--
Mark Mahacek
Merced County Office of Education


"Patrik Berglund" <patrik.berglund@gmail.com> wrote in message
news:1125474676.843722.89120@g49g2000cwa.googlegroups.com...
> Hi!
>
> I'm no expert at VB.NET, but this might work for you:
>
> If TypeOf channelItem Is Channel Then
> .....
> End If
>
> A colleague of mine suggested using a converter such as
> http://www.kamalpatel.net/ConvertCSharp2VB.aspx to convert c# to
> VB.Net.
>
> /Patrik
>







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 06:26 AM.      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