This is A C# Practice code:
Video For Result:
- 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;
- using System.Data.SqlClient;
- namespace dataentry
- {
- public partial class UserLogin : Form
- {
- public UserLogin()
- {
- InitializeComponent();
- }
- private void button5_Click(object sender, EventArgs e)
- {
- int A = 0, B = 0;
- for (A = 0; A < dataGridView1.Rows.Count; ++A)
- {
- B += Convert.ToInt32(dataGridView1.Rows[A].Cells[4].Value);
- }
- label10.Text = B.ToString();
- }
- private void button6_Click(object sender, EventArgs e)
- {
- {
- int A = 0, B = 0;
- for (A = 0; A < dataGridView1.Rows.Count; ++A)
- {
- B += Convert.ToInt32(dataGridView1.Rows[A].Cells[4].Value);
- }
- int NUMofROWS = dataGridView1.Rows.Count;
- double AVG = B / NUMofROWS;
- label11.Text = AVG.ToString();
- }
- }
- private void button8_Click(object sender, EventArgs e)
- {
- int A = 0, B = 0;
- for (A = 0; A < dataGridView1.Rows.Count; ++A)
- {
- B += Convert.ToInt32(dataGridView1.Rows[A].Cells[5].Value);
- }
- label13.Text = B.ToString();
- }
- private void button7_Click(object sender, EventArgs e)
- {
- int A = 0, B = 0;
- for (A = 0; A < dataGridView1.Rows.Count; ++A)
- {
- B += Convert.ToInt32(dataGridView1.Rows[A].Cells[5].Value);
- }
- int NUMofROWS = dataGridView1.Rows.Count;
- double AVG = B / NUMofROWS;
- label12.Text = AVG.ToString();
- }
- }
- }
Facebook Comment