Professional Documents
Culture Documents
Aim:
Alogorithm:
CommonData.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
namespace Student
{
class CommonData
{
public static DataTable Stud;
public static DataTable Course;
}
}
Program.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
namespace Student
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Main());
}
Output:
MAIN FORM:
Program:
Main.cs
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 Student
{
public partial class Main : Form
{
public Main()
{
InitializeComponent();
}
Student-Form:
{
Course cr = new Course();
cr.Show();
}
private void btnDisplayYr_Click(object sender, EventArgs e)
{
studentsYearWise sty = new studentsYearWise();
sty.Show();
}
private void Main_Load(object sender, EventArgs e)
{
}
}
}
Student.cs
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 Student
{
public partial class Student : Form
{
public Student()
{
CommonData.Stud = new DataTable();
CommonData.Stud.Columns.Add("USN");
CommonData.Stud.Columns.Add("StudName");
CommonData.Stud.Columns.Add("Address");
CommonData.Stud.Columns.Add("CourseID");
CommonData.Stud.Columns.Add("YrOfAdmsn");
InitializeComponent()
}
private void btnClear_Click(object sender, EventArgs e)
{
}
Course-Form:
Course.cs
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 Student
{
public partial class Course : Form
{
public Course()
{
InitializeComponent();
}
Student-Details
v
}
StudentDetails.cs
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 Student
{
public partial class studentDetails : Form
{
public studentDetails()
{
InitializeComponent();
}
+ "'"); //CourseID='10'
Output:
Student-Year Wise
gridData.DataSource = dr.CopyToDataTable();
gridData.Refresh();
}
private void btnClose_Click(object sender, EventArgs e)
{
this.Close();
}
namespace Student
{
public partial class studentsYearWise : Form
{
public studentsYearWise()
{
InitializeComponent();
}