473,498 Members | 1,819 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Convert this to C#

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
Nov 15 '05 #1
8 3819
static Type[] types = {blah, blah , blah};
"Sachi" <sa*************@hotmail.com> wrote in message
news:08****************************@phx.gbl...
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

Nov 15 '05 #2
static Type[] types = new Type[] { typeof(string), typeof(byte),
typeof(Int16), typeof(Int32), typeof(Int64), typeof(Single), typeof(Double),
typeof(Decimal), typeof(DateTime) };
"Sachi" <sa*************@hotmail.com> wrote in message
news:08****************************@phx.gbl...
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

Nov 15 '05 #3
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
-----Original Message-----
static Type[] types = new Type[] { typeof(string), typeof (byte),typeof(Int16), typeof(Int32), typeof(Int64), typeof (Single), typeof(Double),typeof(Decimal), typeof(DateTime) };


Nov 15 '05 #4
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
-----Original Message-----
static Type[] types = new Type[] { typeof(string), typeof

Nov 15 '05 #5
Sachi <sa*************@hotmail.com> wrote:
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.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #6
Can I send it to you by email?

...
Sachi
-----Original Message-----
Please post a complete program which shows the problem.


Nov 15 '05 #7
Sachi <sa*************@hotmail.com> wrote:
Can I send it to you by email?


Yup, that's fine. But please make it as short as possible - and when
you've done that, you'll find it won't be too long to post in the
newsgroups anyway. See
http://www.pobox.com/~skeet/csharp/complete.html for some guidelines to
make it easier - you may solve your own problem by following them, too.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #8
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")
};

Sachi wrote:
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


Nov 15 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
7245
by: Lauren Quantrell | last post by:
I have a stored procedure using Convert where the exact same Convert string works in the SELECT portion of the procedure but fails in the WHERE portion. The entire SP is listed below....
1
1787
by: Logan X via .NET 247 | last post by:
It's official....Convert blows. I ran a number of tests converting a double to an integer usingboth Convert & CType. I *ASSUMED* that CType would piggy-back ontop of Convert, and that performance...
4
3598
by: Eric Lilja | last post by:
Hello, I've made a templated class Option (a child of the abstract base class OptionBase) that stores an option name (in the form someoption=) and the value belonging to that option. The value is...
7
7071
by: whatluo | last post by:
Hi, all I'm now working on a program which will convert dec number to hex and oct and bin respectively, I've checked the clc but with no luck, so can anybody give me a hit how to make this done...
3
10238
by: Convert TextBox.Text to Int32 Problem | last post by:
Need a little help here. I saw some related posts, so here goes... I have some textboxes which are designed for the user to enter a integer value. In "old school C" we just used the atoi function...
7
29150
by: patang | last post by:
I want to convert amount to words. Is there any funciton available? Example: $230.30 Two Hundred Thirty Dollars and 30/100
4
4501
by: Edwin Knoppert | last post by:
In my code i use the text from a textbox and convert it to a double value. I was using Convert.ToDouble() but i'm used to convert comma to dot. This way i can assure the text is correct. However...
1
3566
by: johnlim20088 | last post by:
Hi, Currently I have 6 web projects located in Visual Source Safe 6.0, as usual, everytime I will open solution file located in my local computer, connected to source safe, then check out/check in...
6
4239
by: Ken Fine | last post by:
This is a basic question. What is the difference between casting and using the Convert.ToXXX methods, from the standpoint of the compiler, in terms of performance, and in other ways? e.g. ...
0
10705
Debadatta Mishra
by: Debadatta Mishra | last post by:
Introduction In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information...
0
7005
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7168
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7210
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7381
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4916
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4595
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1424
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
659
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
293
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.