.Net Basic #1 – Converting between data type

February 27, 2009

(0) Comments

Disclaimer : This tutorial is meant for beginners and for anyone who find it useful. The main purpose of this post to keep everything i find useful for future reference for myself and for others.

Converting between data types in .Net made easy by System.Convert class , for example to convert double to int all you need is these codes

double d=3.27;
int i=System.Convert.ToInt32(d);

The System.Convert class has the following methods:

* ToBoolean
* ToByte
* ToChar
* ToDateTime
* ToDecimal
* ToDouble
* ToInt16
* ToInt32
* ToInt64
* ToSingle
* ToString
* and some more….

BALA SINGAM

, , , , ,


1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Hello world!

June 23, 2008

(0) Comments

Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!

protected void Button1_Click(object sender, System.EventArgs e)
{
Label1.Text = “Hello “ + Textbox1.Text;
}

BALA SINGAM


1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...