Windows Phone Developers

Showing posts with label C# Tips. Show all posts
Showing posts with label C# Tips. Show all posts

Friday, May 7, 2010

Input string was not in a correct format. - Csharp/VB.NET WriteLine Function

If you are using VB.NET/C# Writeline function and facing the following error, it has to do with formatting


Wrong :
double Sal = 1250.45;
        Console.WriteLine("Salary before hike is {0:D}", Sal); //Decimal instead of double
        Console.WriteLine("Salary before hike is {F}", Sal); //Index is missing
            

Correct:
double Sal = 1250.45;
        
Console.WriteLine("Salary before hike is {0:F}", Sal);


USe appropriate composite format string - decimal , double Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Facebook Google Bookmark Yahoo
ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl StumbleUpon

Saturday, October 11, 2008

What is an Abstract Class / Abstract Classes in C#

Abstract classes are the ones that do not require instantiation. Abstract classes should never be instantiated, it is important to correctly define their constructors. It is also important to ensure that the functionality of your abstract class is correct and easily extended

Abstract (MustInherit in Visual Basic) classes can behave like interfaces or regular classes in that they can define members, and they can provide implementation details but are not required to do so. If an abstract class does not provide implementation details, concrete classes that inherit from the abstract class are required to provide the implementation.

For more info please visit msdn.microsoft.com

Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Facebook Google Bookmark Yahoo
ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl StumbleUpon