Kartik Patel
Kartik Patel

Reputation: 17

Difference between System.Convert.ToInt64() and Convert.ToInt64()

Explain with Example if possible.... For example

   int s=System.Convert.ToInt64(txtno.Text);
   int k=Convert.ToInt64(txtno.Text);

Upvotes: 1

Views: 214

Answers (3)

TWA
TWA

Reputation: 12816

They are exactly the same, a using directive (using System) makes leaving off the System qualifier possible.

Upvotes: 1

jmcasal
jmcasal

Reputation: 81

None. Its the same. (if you not define a Convert class in your namespace).

Upvotes: 0

SWeko
SWeko

Reputation: 30872

They are the same.

On top of the file you have the line

using System;

That means that when you use types and classes defined in the System namespace, you do not need to specify "System" explicitly.
Thus, System.Convert and Convert refer to exactly the same thing, the latter is just shorter to write.

Upvotes: 2

Related Questions