Click here to Skip to main content
15,914,820 members
Home / Discussions / C#
   

C#

 
AnswerIf you don't want to use the API Pin
Ennis Ray Lynch, Jr.13-Jul-06 10:17
Ennis Ray Lynch, Jr.13-Jul-06 10:17 
GeneralRe: If you don't want to use the API Pin
smcneese13-Jul-06 10:38
smcneese13-Jul-06 10:38 
GeneralThe server settings Pin
Ennis Ray Lynch, Jr.13-Jul-06 11:00
Ennis Ray Lynch, Jr.13-Jul-06 11:00 
AnswerRe: Sending Email with Attachment from Winform App Using Default Client Pin
Josh Smith13-Jul-06 11:20
Josh Smith13-Jul-06 11:20 
QuestionCalculation Ouput Pin
Skanless13-Jul-06 9:35
Skanless13-Jul-06 9:35 
AnswerRe: Calculation Ouput Pin
Josh Smith13-Jul-06 10:27
Josh Smith13-Jul-06 10:27 
AnswerRe: Calculation Ouput Pin
cje13-Jul-06 11:52
cje13-Jul-06 11:52 
AnswerRe: Calculation Ouput Pin
Rob Graham13-Jul-06 12:12
Rob Graham13-Jul-06 12:12 
The code you posted will not compile. The function AmortDisplay, as written, does not return a value but is declared as returning a string.

In the calculation of Textbox4.text, AmortTime is not converted to a string.
This would be better done using String.Format anyway.
There is no error handling (try...catch) to capture conversion errors,
so any exception will just propagate up to the top and crash...
Why do you convert the result of CalculateBalance nto a string
(as the return value) and then immediatly convert it back
to a double in order to pass it to AmmortDisplay?

Clean up your code. avoid conversion operations in the parameters passed
to a function (do these as separate steps with local values,
pass the local values) - this:
AmortDisplay(Convert.ToDouble(TextBox1.Text),
       Convert.ToDouble(Label6.Text),
       Convert.ToInt32(TextBox3.Text),
       Convert.ToInt16(DropDownList1.SelectedItem.Value)).ToString();

will be very hard to debug, and there are at least 5 opportunities
for a mistyped (or empty) entry field to cause an exception to be thrown
in that single function call.
Why the .ToString() at the end? the function called should have returned a string
(and would have, but you left out the return statement) anyway..

You definately need to study harder. This is really poor code, and would be unacceptable
in any production work.
Some advice:
1. Keep it simple, avoid complex function calls with nested calls
2. do things in clear descrete steps so you can inspect each easily.
3. don't change data types any earlier than necessary.
4. inspect your code with the presumption that there is a stupid error or oversight,
the best of us still make these occaisionally.

AnswerRe: Calculation Ouput Pin
Guffa13-Jul-06 12:15
Guffa13-Jul-06 12:15 
QuestionDuplicating the contents of a treeView Pin
AngryC13-Jul-06 9:30
AngryC13-Jul-06 9:30 
AnswerRe: Duplicating the contents of a treeView Pin
Ennis Ray Lynch, Jr.13-Jul-06 9:38
Ennis Ray Lynch, Jr.13-Jul-06 9:38 
GeneralRe: Duplicating the contents of a treeView Pin
AngryC13-Jul-06 9:47
AngryC13-Jul-06 9:47 
AnswerRe: Duplicating the contents of a treeView Pin
BoneSoft13-Jul-06 9:57
BoneSoft13-Jul-06 9:57 
QuestionTextBox Array in C#.NET Pin
orentuil13-Jul-06 9:18
orentuil13-Jul-06 9:18 
AnswerRe: TextBox Array in C#.NET Pin
Josh Smith13-Jul-06 9:23
Josh Smith13-Jul-06 9:23 
GeneralRe: TextBox Array in C#.NET Pin
orentuil13-Jul-06 9:54
orentuil13-Jul-06 9:54 
Questionsaving color in databse and retring Pin
_tasleem13-Jul-06 9:16
_tasleem13-Jul-06 9:16 
AnswerRe: saving color in databse and retring Pin
BoneSoft13-Jul-06 9:51
BoneSoft13-Jul-06 9:51 
GeneralUse the Int32 constructor Pin
Ennis Ray Lynch, Jr.13-Jul-06 10:19
Ennis Ray Lynch, Jr.13-Jul-06 10:19 
GeneralRe: saving color in databse and retring Pin
Josh Smith13-Jul-06 10:28
Josh Smith13-Jul-06 10:28 
GeneralRe: saving color in databse and retring Pin
BoneSoft13-Jul-06 11:35
BoneSoft13-Jul-06 11:35 
GeneralRe: saving color in databse and retring Pin
Josh Smith13-Jul-06 16:53
Josh Smith13-Jul-06 16:53 
QuestionGrouped Check Boxes Pin
joshp121713-Jul-06 9:04
joshp121713-Jul-06 9:04 
AnswerRe: Grouped Check Boxes Pin
Josh Smith13-Jul-06 9:06
Josh Smith13-Jul-06 9:06 
GeneralRe: Grouped Check Boxes Pin
joshp121713-Jul-06 9:08
joshp121713-Jul-06 9:08 

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.