Click here to Skip to main content
16,004,944 members
Home / Discussions / C#
   

C#

 
AnswerDuplicate Post (in one hour). Please ignore Pin
Vasudevan Deepak Kumar29-Nov-07 23:57
Vasudevan Deepak Kumar29-Nov-07 23:57 
QuestionResult of division not appear in the textbox Pin
PeterRoman29-Nov-07 23:53
PeterRoman29-Nov-07 23:53 
AnswerRe: Result of division not appear in the textbox Pin
Shpendh29-Nov-07 23:58
Shpendh29-Nov-07 23:58 
GeneralRe: Result of division not appear in the textbox Pin
sreejithnbr30-Nov-07 1:02
sreejithnbr30-Nov-07 1:02 
QuestionRe: Result of division not appear in the textbox Pin
Vasudevan Deepak Kumar29-Nov-07 23:59
Vasudevan Deepak Kumar29-Nov-07 23:59 
AnswerRe: Result of division not appear in the textbox Pin
Colin Angus Mackay30-Nov-07 0:20
Colin Angus Mackay30-Nov-07 0:20 
AnswerRe: Result of division not appear in the textbox Pin
Frank Kerrigan30-Nov-07 0:42
Frank Kerrigan30-Nov-07 0:42 
GeneralRe: Result of division not appear in the textbox Pin
moon_stick30-Nov-07 1:10
moon_stick30-Nov-07 1:10 
Though this isn't particularly robust code. Better would be to use something like:

double valor1, valor2;<br />
double resultado;<br />
<br />
if (!double.TryParse(txtValor1.Text, valor1))<br />
{<br />
    valor1 = 0;<br />
}<br />
if (!double.TryParse(txtValor2.Text, valor2))<br />
{<br />
    valor2 = 0;<br />
}<br />
<br />
if (opcDivide.Checked)<br />
{<br />
    try<br />
    {<br />
        resultado = valor1/valor2;<br />
        txtResultado.Text = resultado.ToString();<br />
    }<br />
    catch (DivideByZeroException e)<br />
    {<br />
        txtResultado.Text = "Error";<br />
    }<br />
}


HTH

Dave

It definitely isn't definatley

GeneralRe: Result of division not appear in the textbox Pin
Luc Pattyn30-Nov-07 1:49
sitebuilderLuc Pattyn30-Nov-07 1:49 
GeneralRe: Result of division not appear in the textbox Pin
moon_stick30-Nov-07 3:24
moon_stick30-Nov-07 3:24 
GeneralRe: Result of division not appear in the textbox Pin
PeterRoman30-Nov-07 3:08
PeterRoman30-Nov-07 3:08 
QuestionLinq on Visual 2005 Pin
Berlus29-Nov-07 23:39
Berlus29-Nov-07 23:39 
AnswerRe: Linq on Visual 2005 Pin
Colin Angus Mackay30-Nov-07 0:22
Colin Angus Mackay30-Nov-07 0:22 
AnswerRe: Linq on Visual 2005 Pin
Pete O'Hanlon30-Nov-07 0:26
mvePete O'Hanlon30-Nov-07 0:26 
AnswerRe: Linq on Visual 2005 Pin
Frank Kerrigan30-Nov-07 0:36
Frank Kerrigan30-Nov-07 0:36 
QuestionCreating Website in SharePoint using C#/ASP.NET Pin
md Nazeem29-Nov-07 23:37
md Nazeem29-Nov-07 23:37 
Questionopen an Excel file using c# Pin
ramyanaidu29-Nov-07 23:37
ramyanaidu29-Nov-07 23:37 
AnswerRe: open an Excel file using c# Pin
NewToAspDotNet30-Nov-07 0:35
NewToAspDotNet30-Nov-07 0:35 
Question"out of memory" exception and resource management Pin
metalion29-Nov-07 23:14
metalion29-Nov-07 23:14 
AnswerRe: "out of memory" exception and resource management Pin
Christian Graus29-Nov-07 23:17
protectorChristian Graus29-Nov-07 23:17 
GeneralRe: "out of memory" exception and resource management Pin
metalion29-Nov-07 23:23
metalion29-Nov-07 23:23 
AnswerRe: "out of memory" exception and resource management Pin
Luc Pattyn30-Nov-07 0:45
sitebuilderLuc Pattyn30-Nov-07 0:45 
GeneralRe: "out of memory" exception and resource management Pin
metalion30-Nov-07 1:25
metalion30-Nov-07 1:25 
QuestionIDeviceContext OR How to MeasureText out of the Paint Event Pin
C-Scharbe29-Nov-07 23:04
C-Scharbe29-Nov-07 23:04 
AnswerRe: IDeviceContext OR How to MeasureText out of the Paint Event Pin
C-Scharbe30-Nov-07 1:04
C-Scharbe30-Nov-07 1:04 

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.