| Purchase | |
| Sales | |
| Return | |
| Balance | |
in my TextBox4_TextChanged it throw error as
Server Error in '/retrievedata' Application.
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.Compiler Error Message: CS0103: The name 'c' does not exist in the current context
Source Error:
|
Source File: d:\sample tools\retrievedata\Default.aspx.cs Line: 87
i need in the balnce field as output as 5.in the textbox


Lakshmanan Sethu SankaranarayanRank #124 · 17.7K reputationPosted Apr 28, 2014, 11:51 PM EDT
selvi subramanianRank #2,007 · 723 reputationPosted Apr 28, 2014, 11:58 PM EDT
Lakshmanan Sethu SankaranarayanRank #124 · 17.7K reputationPosted Apr 29, 2014, 12:25 AM EDT
Use the following code
else if (int.Parse(TextBox3.Text)!= 0)
{
int c = int.Parse(TextBox3.Text) + int.Parse(TextBox4.Text);
TextBox3.Text = Convert.ToString(c);
}
selvi subramanianRank #2,007 · 723 reputationPosted Apr 29, 2014, 12:29 AM EDT
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.this also show this error
Input string was not in a correct format.
Exception Details: System.FormatException: Input string was not in a correct format.
Source Error:
Line 59: //Label1.Text = "balance is nill"; Line 60: } Line 61: else if (int.Parse(TextBox3.Text) != 0) Line 62: { Line 63: int c = int.Parse(TextBox3.Text) + int.Parse(TextBox4.Text);Source File: d:\sample tools\retrievedata\Default.aspx.cs Line: 61
Stack Trace:
[FormatException: Input string was not in a correct format.] System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +7470887 System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +119 System.Int32.Parse(String s) +23 _Default.TextBox4_TextChanged(Object sender, EventArgs e) in d:\sample tools\retrievedata\Default.aspx.cs:61 System.Web.UI.WebControls.TextBox.OnTextChanged(EventArgs e) +8755606 System.Web.UI.WebControls.TextBox.RaisePostDataChangedEvent() +55 System.Web.UI.WebControls.TextBox.System.Web.UI.IPostBackDataHandler.RaisePostDataChangedEvent() +10 System.Web.UI.Page.RaiseChangedEvents() +165 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1485Version Information: Microsoft .NET Framework Version:2.0.50727.4984; ASP.NET Version:2.0.50727.4971
Lakshmanan Sethu SankaranarayanRank #124 · 17.7K reputationPosted Apr 29, 2014, 12:32 AM EDT
Lakshmanan Sethu SankaranarayanRank #124 · 17.7K reputationPosted Apr 29, 2014, 12:34 AM EDT
Please try this
else if (int.Parse(TextBox3.Text)!= 0)
{
int c = int.Parse(TextBox3.Text) + int.Parse(TextBox4.Text);
TextBox3.Text = Convert.ToString(c);
}