Click here to Skip to main content
15,909,051 members
Home / Discussions / C#
   

C#

 
GeneralRe: HELP! Processor at 100% Pin
Rabbit1710-Jul-06 12:07
Rabbit1710-Jul-06 12:07 
GeneralRe: HELP! Processor at 100% Pin
Not Active10-Jul-06 12:13
mentorNot Active10-Jul-06 12:13 
GeneralRe: HELP! Processor at 100% Pin
LongRange.Shooter11-Jul-06 9:02
LongRange.Shooter11-Jul-06 9:02 
Questionreturning more than one item Pin
Tom Wright10-Jul-06 10:58
Tom Wright10-Jul-06 10:58 
AnswerRe: returning more than one item Pin
Christian Graus10-Jul-06 11:06
protectorChristian Graus10-Jul-06 11:06 
AnswerRe: returning more than one item Pin
Aaron Dilliard11-Jul-06 4:09
Aaron Dilliard11-Jul-06 4:09 
Questiondisplay folder path in dialog text box Pin
x2pca10-Jul-06 9:41
x2pca10-Jul-06 9:41 
AnswerRe: display folder path in dialog text box Pin
Christian Graus10-Jul-06 9:52
protectorChristian Graus10-Jul-06 9:52 
GeneralRe: display folder path in dialog text box Pin
Jun Du10-Jul-06 10:05
Jun Du10-Jul-06 10:05 
QuestionRe: display folder path in dialog text box Pin
Nader Elshehabi10-Jul-06 13:49
Nader Elshehabi10-Jul-06 13:49 
AnswerRe: display folder path in dialog text box Pin
Jun Du10-Jul-06 15:32
Jun Du10-Jul-06 15:32 
JokeRe: display folder path in dialog text box Pin
Nader Elshehabi10-Jul-06 16:20
Nader Elshehabi10-Jul-06 16:20 
AnswerRe: display folder path in dialog text box Pin
Josh Smith10-Jul-06 10:37
Josh Smith10-Jul-06 10:37 
QuestionDataset copy Pin
Small Rat10-Jul-06 8:36
Small Rat10-Jul-06 8:36 
AnswerRe: Dataset copy Pin
Josh Smith10-Jul-06 8:40
Josh Smith10-Jul-06 8:40 
QuestionCalcBalance does not exist in the current context Pin
Skanless10-Jul-06 7:09
Skanless10-Jul-06 7:09 
I am coding a interest calculator in C# using Visual Studio 2005 Express edition and I keep on getting the following error: "CalcBalance does not exist in the current context". I am not sure what's cuasing it or how to fix it. Any advice which would help in get this code working would be greatly appreciated. Below is the full code:

<%@ Control Language="C#" ClassName="WebUserControl" %>



protected void Button1_Click(object sender, EventArgs e)
{
Label6.Text = "Final Balance: $" +
CalcBalance(Convert.ToInt32(TextBox1.Text),
(Convert.ToInt32(TextBox2.Text) / 100),
Convert.ToInt32(TextBox3.Text),
Convert.ToInt16(DropDownList1.SelectedItem.Value)).ToString();
}

private string CalculateBalance(int Principal, double Rate, int Years, int Period)
{
double result;
double NumToBeRaised = (1 + Rate / Period);
result = Principal * System.Math.Pow(NumToBeRaised, (Years * Period));
return (result.ToString("C"));
}






<asp:label id="Label1" runat="server" style="position: relative" text="Compound interest Calculator" width="318px" font-bold="True" font-size="Large">



<asp:label id="Label2" runat="server" style="position: relative" text="Principal ($)" width="165px">
<asp:textbox id="TextBox1" runat="server" style="position: relative">



<asp:label id="Label3" runat="server" style="position: relative" text="Rate (%)" width="165px">
<asp:textbox id="TextBox2" runat="server" style="position: relative">




<asp:label id="Label4" runat="server" style="position: relative" text="Years:" width="165px">
<asp:textbox id="TextBox3" runat="server" style="position: relative">



<asp:label id="Label5" runat="server" style="position: relative" text="Compound Frequency:" width="165px">
<asp:dropdownlist id="DropDownList1" runat="server" style="position: relative">
<asp:listitem value="1">Annually
<asp:listitem value="4">Quarterly
<asp:listitem value="12">Monthly
<asp:listitem value="365">Daily
<asp:listitem>




<asp:button id="Button1" runat="server" style="left: 9px; position: relative; top: 10px"
="" text="Calculate" width="207px" onclick="Button1_Click">







<asp:label id="Label6" runat="server" style="position: relative" width="165px">



Greg

The Belizean Dan Dada!!!
AnswerRe: CalcBalance does not exist in the current context Pin
Robert Rohde10-Jul-06 7:42
Robert Rohde10-Jul-06 7:42 
AnswerRe: CalcBalance does not exist in the current context Pin
LongRange.Shooter10-Jul-06 8:26
LongRange.Shooter10-Jul-06 8:26 
AnswerRe: CalcBalance does not exist in the current context Pin
wasife10-Jul-06 8:28
wasife10-Jul-06 8:28 
GeneralRe: CalcBalance does not exist in the current context Pin
Josh Smith10-Jul-06 8:37
Josh Smith10-Jul-06 8:37 
AnswerRe: CalcBalance does not exist in the current context Pin
Skanless10-Jul-06 16:37
Skanless10-Jul-06 16:37 
GeneralRe: CalcBalance does not exist in the current context Pin
J4amieC10-Jul-06 21:57
J4amieC10-Jul-06 21:57 
QuestionShow the "video capture filter " form in c# Pin
davilovick10-Jul-06 6:54
davilovick10-Jul-06 6:54 
AnswerRe: Show the "video capture filter " form in c# Pin
LongRange.Shooter10-Jul-06 8:21
LongRange.Shooter10-Jul-06 8:21 
JokeRe: Show the "video capture filter " form in c# Pin
Malcolm Smart10-Jul-06 20:53
Malcolm Smart10-Jul-06 20:53 

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.