i am creating payroll application in vb.net using csharp.in that i am having following fields
PF 800
Loan 5000
Tax 183
Tds 2000
Mobile usage 200
total deductions i want the answer 8183(adding of above PF + Loan + Tax + Tds + Mobile usage) = total deductions is 8183 output
how to do please send the code.
rgds
Narasiman P
Loading
Satyapriya NayakPosted Jul 3, 2012, 1:36 AM
Try this...
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication18
{
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
decimal PF, Loan, Tax, Tds,Mobileusage,total;
PF = Convert.ToDecimal(textBox1.Text);
Loan = Convert.ToDecimal(textBox2.Text);
Tax = Convert.ToDecimal(textBox3.Text);
Tds = Convert.ToDecimal(textBox4.Text);
Mobileusage = Convert.ToDecimal(textBox5.Text);
total = PF + Loan + Tax + Tds + Mobileusage;
label1.Text = "Total deductions is:" + total.ToString();
}
}
}
Thanks