Click here to Skip to main content
15,887,676 members
Home / Discussions / C#
   

C#

 
GeneralRe: disable special key in .NET (C#,VB) for win xp Pin
Eric Dahlvang23-Aug-06 4:09
Eric Dahlvang23-Aug-06 4:09 
GeneralRe: disable special key in .NET (C#,VB) for win xp [modified] Pin
jeedjad23-Aug-06 6:13
jeedjad23-Aug-06 6:13 
QuestionPerformance Test Tool For a Desktop Application Pin
Rohit Dev22-Aug-06 4:01
Rohit Dev22-Aug-06 4:01 
AnswerRe: Performance Test Tool For a Desktop Application Pin
Judah Gabriel Himango22-Aug-06 4:21
sponsorJudah Gabriel Himango22-Aug-06 4:21 
QuestionGenerics: Is x numeric? Pin
Tomerland22-Aug-06 3:57
Tomerland22-Aug-06 3:57 
AnswerRe: Generics: Is x numeric? Pin
S. Senthil Kumar22-Aug-06 4:09
S. Senthil Kumar22-Aug-06 4:09 
AnswerRe: Generics: Is x numeric? Pin
Judah Gabriel Himango22-Aug-06 4:17
sponsorJudah Gabriel Himango22-Aug-06 4:17 
AnswerRe: Generics: Is x numeric? Pin
Eric Dahlvang22-Aug-06 5:20
Eric Dahlvang22-Aug-06 5:20 
Knowledge Base

HOW TO: Implement Visual Basic .NET IsNumeric Functionality by Using Visual C# .NET

This step-by-step article describes how to use the Microsoft Visual Basic .NET IsNumeric function in Visual C# .NET. The IsNumeric function returns a Boolean value that indicates whether an expression can be evaluated as a number. The IsNumeric function returns True when the data type of the expression is Short, Integer, Long, Decimal, Single, or Double. It also returns True if the expression is a string that can be successfully converted to a Double.

Create the IsNumeric Function
In Visual C# .NET, you can use the Double.TryParse method to obtain functionality that is similar to IsNumeric. Double.TryParse
converts the string representation of a number in a specified style and culture-specific format to its double-precision floating point number equivalent. To create the IsNumeric function:
Start Visual Studio .NET. On the File, point to New, and then click Project.
In the New Project dialog box, click Visual C# Projects under Project Type.
Under Templates, click Console Application, and then click OK. By default, Class1.cs is created.
At the end of the Class1 class, add the following code for the IsNumeric function:

// IsNumeric Function
static bool IsNumeric(object Expression)
{
        // Variable to collect the Return value of the TryParse method.
	bool isNum;

        // Define variable to collect out parameter of the TryParse method. 
        // If the conversion fails, the out parameter is zero.
	double retNum;
			
        // The TryParse method converts a string in a specified style and 
        // culture-specific format to its double-precision floating point number equivalent.

        // The TryParse method does not generate an exception if the conversion fails. 
        //If the conversion passes, True is returned. If it does not, False is returned.
	isNum = Double.TryParse(Convert.ToString(Expression), System.Globalization.NumberStyles.Any, System.Globalization.NumberFormatInfo.InvariantInfo, out retNum );
	return isNum;
}		



--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters

QuestionProblem with search DateTime with SQL Pin
ATC22-Aug-06 3:56
ATC22-Aug-06 3:56 
QuestionIs OpenSceneGraph as managed c++ in a C# gui possible? Pin
Atlemann22-Aug-06 3:44
Atlemann22-Aug-06 3:44 
AnswerRe: Is OpenSceneGraph as managed c++ in a C# gui possible? Pin
Judah Gabriel Himango22-Aug-06 4:23
sponsorJudah Gabriel Himango22-Aug-06 4:23 
QuestionEditting the range for an excel pivottable Pin
Goalie3522-Aug-06 3:17
Goalie3522-Aug-06 3:17 
QuestionIsNull with C# Pin
M Riaz Bashir22-Aug-06 3:00
M Riaz Bashir22-Aug-06 3:00 
AnswerRe: IsNull with C# Pin
User 665822-Aug-06 3:04
User 665822-Aug-06 3:04 
GeneralRe: IsNull with C# Pin
Ed.Poore22-Aug-06 4:25
Ed.Poore22-Aug-06 4:25 
GeneralRe: IsNull with C# Pin
User 665822-Aug-06 4:47
User 665822-Aug-06 4:47 
GeneralRe: IsNull with C# Pin
Ed.Poore22-Aug-06 6:09
Ed.Poore22-Aug-06 6:09 
AnswerRe: IsNull with C# Pin
Judah Gabriel Himango22-Aug-06 4:25
sponsorJudah Gabriel Himango22-Aug-06 4:25 
AnswerRe: IsNull with C# Pin
Ed.Poore22-Aug-06 4:26
Ed.Poore22-Aug-06 4:26 
Questionvalidation Pin
nachisaravanan22-Aug-06 2:57
nachisaravanan22-Aug-06 2:57 
AnswerRe: validation Pin
MCSD-Gandalf22-Aug-06 3:25
MCSD-Gandalf22-Aug-06 3:25 
Questionhow to keep a group together in a rdlc report? Pin
gus_br22-Aug-06 2:47
gus_br22-Aug-06 2:47 
AnswerRe: how to keep a group together in a rdlc report? Pin
Alex.Shnaider17-Apr-12 22:29
Alex.Shnaider17-Apr-12 22:29 
Questionhow do i get?... Pin
diddy3422-Aug-06 2:29
diddy3422-Aug-06 2:29 
AnswerRe: how do i get?... Pin
TikkuTakku22-Aug-06 2:41
TikkuTakku22-Aug-06 2:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.