-
Notifications
You must be signed in to change notification settings - Fork 0
/
fitrrr.txt
61 lines (56 loc) · 2.83 KB
/
fitrrr.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
public SemesterDisplay()
{
InitializeComponent();
comboBox1.SelectedIndex = -1;
comboBox2.SelectedIndex = -1;
SqlDataAdapter sqlDA = new SqlDataAdapter("select distinct * from StudentStatus", App.ConnectionString);
DataSet ds = new DataSet();
//copy db to ds
sqlDA.Fill(ds, "StudentStatus");
string sqlselect = "select Student.RollNo,Student.ClassCode,FullName,Nationality,Batch,Major,Name,SemesterNo,Status " +
"from StudentStatus,Student,Class,Semester where Student.RollNo = StudentStatus.RollNo and StudentStatus.SemesterId = Semester.Id and Class.ClassCode = Student.ClassCode";
sqlDA = new SqlDataAdapter(sqlselect, App.ConnectionString);
sqlDA.Fill(ds, "StudentStatus");
// Copy records from ds.Tables["StudentStatus"] to dataview
dv = new DataView(ds.Tables["StudentStatus"]);
//Bind dv to datagridview
dataGridView1.DataSource = dv;
label4.Text = "Total = " + (dataGridView1.RowCount - 1) + " Number of Students.";
}
DataView dv = null;
int semesternum = 0;
string sMajor = "";
string studStatus = "";
bool k;
private void radioButton1_CheckedChanged(object sender, EventArgs e)
{
if (comboBox1.SelectedIndex < 0) comboBox1.SelectedIndex = 0;
if (comboBox2.SelectedIndex < 0) comboBox2.SelectedIndex = 0;
//if (radioButton1.Checked)
//{
sMajor = "ISE";
//}
//displayview();
semesternum = int.Parse(comboBox1.SelectedItem.ToString());
studStatus = comboBox2.SelectedItem.ToString();
//filterRow
dv.RowFilter = "Major like '%" + sMajor + "%' and SemesterNo = " + semesternum.ToString() + " and Status like '%" + studStatus + "%'";
label4.Text = "Total = " + (dataGridView1.RowCount - 1) + " Number of Students.";
k = true;
}
private void radioButton2_CheckedChanged(object sender, EventArgs e)
{
if (comboBox1.SelectedIndex < 0) comboBox1.SelectedIndex = 0;
if (comboBox2.SelectedIndex < 0) comboBox2.SelectedIndex = 0;
if (radioButton1.Checked)
{
sMajor = "IBA";
}
// displayview();
semesternum = int.Parse(comboBox1.SelectedItem.ToString());
studStatus = comboBox2.SelectedItem.ToString();
//filterRow
dv.RowFilter = "Major like '%" + sMajor + "%' and SemesterNo = " + semesternum.ToString() + " and Status like '%" + studStatus + "%'";
label4.Text = "Total = " + (dataGridView1.RowCount - 1) + " Number of Students.";
k = true;
}