Convert this to C#

S

Sachi

Hi,
Can anyone convert for me this Vb.bet code into C#?
I am trying to convert example a sample from MSDN article.


Static types() As Type = {GetType(String), GetType(Byte),
_
GetType(Int16), GetType(Int32), GetType(Int64),
GetType(Single), _
GetType(Double), GetType(Decimal), GetType
(DateTime)}


Thanks and Regards,
Sachi
 
N

Nicholas

static Type[] types = new Type[] { typeof(string), typeof(byte),
typeof(Int16), typeof(Int32), typeof(Int64), typeof(Single), typeof(Double),
typeof(Decimal), typeof(DateTime) };
 
S

Sachi

I am doing this in the functions first like.

when I put this statement itself totally other lines are
show as error!!!Any idea?

...
Sachi
 
S

Sachi

Actually I am trying to convert a sample textbox validator
from msdn site to C#. That is why facing this problems?

Any one had converted that textbox validator code into C#?

...
Sachi
 
J

Jon Skeet [C# MVP]

Sachi said:
I am doing this in the functions first like.

when I put this statement itself totally other lines are
show as error!!!Any idea?

Please post a complete program which shows the problem.
 
Q

q

The simple solution is:
static Type[] types = {
System.Type.GetType("String"),
System.Type.GetType("Byte"),
System.Type.GetType("Int16"),
System.Type.GetType("Int32"),
System.Type.GetType("Int64"),
System.Type.GetType("Single"),
System.Type.GetType("Double"),
System.Type.GetType("Decimal"),
System.Type.GetType ("DateTime")
};
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top