how to writ code for percentage in windows application form
-
i wants to calculate salary percentage plz send ne code
-
i wants to calculate salary percentage plz send ne code
Seriously?
Value = (Salary / 100) * percentage;
I'll let you determine the types required
Every day, thousands of innocent plants are killed by vegetarians. Help end the violence EAT BACON
-
Seriously?
Value = (Salary / 100) * percentage;
I'll let you determine the types required
Every day, thousands of innocent plants are killed by vegetarians. Help end the violence EAT BACON
private void btnDelete_Click(object sender, EventArgs e) { int id = Convert.ToInt32(txtId.Text); string name = txtName.Text; decimal sal = Convert.ToDecimal(txtSal.Text); cmd.CommandText = "Delete from Emp where EmpId = " + id; cmd.Connection = con; con.Open(); cmd.ExecuteNonQuery(); con.Close(); } private void btnCalc_Click(object sender, EventArgs e) { int Result; int Total; int sal = int.Parse(txtper.Text); Value = (Salary / 100) * percentage; } like this i wrote still it is getting error
-
private void btnDelete_Click(object sender, EventArgs e) { int id = Convert.ToInt32(txtId.Text); string name = txtName.Text; decimal sal = Convert.ToDecimal(txtSal.Text); cmd.CommandText = "Delete from Emp where EmpId = " + id; cmd.Connection = con; con.Open(); cmd.ExecuteNonQuery(); con.Close(); } private void btnCalc_Click(object sender, EventArgs e) { int Result; int Total; int sal = int.Parse(txtper.Text); Value = (Salary / 100) * percentage; } like this i wrote still it is getting error
Value = (Salary / 100) * percentage;
Value
would the the variable that you want to store the result inSalary
would be the variable / object that stores the salary valuepercentage
would be the variable / object that stores the percentage that you want to do the multiplication by. The answer I gave you was a formula to find out the what a percentage of X would be.Every day, thousands of innocent plants are killed by vegetarians. Help end the violence EAT BACON
-
private void btnDelete_Click(object sender, EventArgs e) { int id = Convert.ToInt32(txtId.Text); string name = txtName.Text; decimal sal = Convert.ToDecimal(txtSal.Text); cmd.CommandText = "Delete from Emp where EmpId = " + id; cmd.Connection = con; con.Open(); cmd.ExecuteNonQuery(); con.Close(); } private void btnCalc_Click(object sender, EventArgs e) { int Result; int Total; int sal = int.Parse(txtper.Text); Value = (Salary / 100) * percentage; } like this i wrote still it is getting error
iam still getting error plz send me complete code
-
private void btnDelete_Click(object sender, EventArgs e) { int id = Convert.ToInt32(txtId.Text); string name = txtName.Text; decimal sal = Convert.ToDecimal(txtSal.Text); cmd.CommandText = "Delete from Emp where EmpId = " + id; cmd.Connection = con; con.Open(); cmd.ExecuteNonQuery(); con.Close(); } private void btnCalc_Click(object sender, EventArgs e) { int Result; int Total; int sal = int.Parse(txtper.Text); Value = (Salary / 100) * percentage; } like this i wrote still it is getting error
ashwini dharamsale wrote:
int Result; int Total; int sal = int.Parse(txtper.Text); Value = (Salary / 100) * percentage;
For real? Pro tip: replace placeholders when copy&pasting code. Epic pro tip: please learn enough C# to at least understand the compilation errors you're getting. It's obvious that you put exactly zero effort in this.
-
iam still getting error plz send me complete code
ashwini dharamsale wrote:
iam still getting error
Out of the 46,298 errors that you could be getting you seriously expect us to guess with is the one error that you are getting? Do you realize that it's Friday and most of us have used up all of our mind reading credits for the week.
ashwini dharamsale wrote:
send me complete code
What? No mention of how much you are going to pay us to do your work for you? Or, how you intend to pay?
-
iam still getting error plz send me complete code
Why? None of us is getting paid or a qualification for it. I don't think it is up to us to let you breeze through life hiding your own inability to code through the work of others. What you want is a fairly easy thing to do, I certainly could have done this aged 11 (probably younger). You have two real options: 1. Learn at least the basics of programming and debugging. We will help if we aren't be expected to write your code for you or taken advantage of. 2. Leave development as a career. This is a sane option for many people, most of the population just doesn't have the correct type of thought processes for coding. If you are a beginner at coding, then you need to state what your problem is - you say you have an error but do not state what it is. At the very least I can see from skimming your code you aren't updating anything on the form. Again, asking for you code to be written for you won't get a helpful response.
PB 369,783 wrote:
I just find him very unlikeable, and I think the way he looks like a prettier version of his Mum is very disturbing.[^]
-
ashwini dharamsale wrote:
iam still getting error
Out of the 46,298 errors that you could be getting you seriously expect us to guess with is the one error that you are getting? Do you realize that it's Friday and most of us have used up all of our mind reading credits for the week.
ashwini dharamsale wrote:
send me complete code
What? No mention of how much you are going to pay us to do your work for you? Or, how you intend to pay?
Out of memory...... Good luck! Best error ever!
=)
-
private void btnDelete_Click(object sender, EventArgs e) { int id = Convert.ToInt32(txtId.Text); string name = txtName.Text; decimal sal = Convert.ToDecimal(txtSal.Text); cmd.CommandText = "Delete from Emp where EmpId = " + id; cmd.Connection = con; con.Open(); cmd.ExecuteNonQuery(); con.Close(); } private void btnCalc_Click(object sender, EventArgs e) { int Result; int Total; int sal = int.Parse(txtper.Text); Value = (Salary / 100) * percentage; } like this i wrote still it is getting error
private void btnCalc_Click(object sender, EventArgs e)
{
int Value;
int percentage = 10;
int sal = 99999;
Value = (sal / 100) * percentage;
btnCalc.Text = Value.ToString();
}I fixed it! had to assume a lot here.
=)
-
private void btnDelete_Click(object sender, EventArgs e) { int id = Convert.ToInt32(txtId.Text); string name = txtName.Text; decimal sal = Convert.ToDecimal(txtSal.Text); cmd.CommandText = "Delete from Emp where EmpId = " + id; cmd.Connection = con; con.Open(); cmd.ExecuteNonQuery(); con.Close(); } private void btnCalc_Click(object sender, EventArgs e) { int Result; int Total; int sal = int.Parse(txtper.Text); Value = (Salary / 100) * percentage; } like this i wrote still it is getting error
There are a lot of problems here, some of which will prevent it compiling. Assuming that you have declared
Value
as a class level field or property: 1)Salary
does not exist - I suspect you also want this as a class level field or property. 2)percentage
does not exists, I assume that the variable you declared on the line above should be calledpercentage
, notsal
That should cure your compiler errors, but I suspect it won't give you the right result unless you have been careful about the variable types, which it doesn't appear you have so far!This message is manufactured from fully recyclable noughts and ones. To recycle this message, please separate into two tidy piles, and take them to your nearest local recycling centre. Please note that in some areas noughts are always replaced with zeros by law, and many facilities cannot recycle zeroes - in this case, please bury them in your back garden and water frequently.
-
There are a lot of problems here, some of which will prevent it compiling. Assuming that you have declared
Value
as a class level field or property: 1)Salary
does not exist - I suspect you also want this as a class level field or property. 2)percentage
does not exists, I assume that the variable you declared on the line above should be calledpercentage
, notsal
That should cure your compiler errors, but I suspect it won't give you the right result unless you have been careful about the variable types, which it doesn't appear you have so far!This message is manufactured from fully recyclable noughts and ones. To recycle this message, please separate into two tidy piles, and take them to your nearest local recycling centre. Please note that in some areas noughts are always replaced with zeros by law, and many facilities cannot recycle zeroes - in this case, please bury them in your back garden and water frequently.
His errors are due to a copy and paste problem http://www.codeproject.com/Messages/4648703/Re-how-to-writ-code-for-percentage-in-windows-appl.aspx[^]
Every day, thousands of innocent plants are killed by vegetarians. Help end the violence EAT BACON
-
His errors are due to a copy and paste problem http://www.codeproject.com/Messages/4648703/Re-how-to-writ-code-for-percentage-in-windows-appl.aspx[^]
Every day, thousands of innocent plants are killed by vegetarians. Help end the violence EAT BACON
I am assuming the problem is "I want to copy your work and paste it in as my homework"?
This message is manufactured from fully recyclable noughts and ones. To recycle this message, please separate into two tidy piles, and take them to your nearest local recycling centre. Please note that in some areas noughts are always replaced with zeros by law, and many facilities cannot recycle zeroes - in this case, please bury them in your back garden and water frequently.