course.
cs
----------using System;
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
namespace student
{
public partial class course : Form
{
String connection = "Server=localhost;Database=1rz14mca20;Uid=root;Pwd=m
ca";
MySqlConnection con;
MySqlCommand cmd;
public course()
{
InitializeComponent();
con = new MySqlConnection(connection);
}
private void Add_Click_1(object sender, EventArgs e)
{
[Link]();
try
{
cmd = [Link]();
[Link] = "INSERT INTO tbl_course(courseName) values(?co
urseName)";
[Link]();
[Link]("?courseName", [Link]);
[Link]();
}
catch (Exception)
{
throw;
}
finally
{
[Link]();
[Link]();
}
}
private void show_Click_1(object sender, EventArgs e)
{
[Link]();
MySqlDataAdapter adapter = new MySqlDataAdapter("select * from tbl_c
ourse", con);
DataSet ds = new DataSet();
[Link](ds, "c");
[Link] = [Link]["c"];
[Link]();
}
private void Delete_Click_1(object sender, EventArgs e)
{
[Link]();
try
{
cmd = [Link]();
[Link] = "delete from tbl_course where courseName=?cour
seName";
[Link]();
[Link]("?courseName", [Link]);
[Link]();
}
catch (Exception)
{
throw;
}
finally
{
// [Link]();
[Link]();
[Link]();
}
}
}
}
particuler_course.cs
--------------------using System;
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
namespace student
{
public partial class particular_course : Form
{
MySqlConnection con = new MySqlConnection("server=localhost;database=1rz
14mca20;uid=root;pwd=mca");
MySqlCommand cmd;
public particular_course()
{
InitializeComponent();
[Link]();
cmd = new MySqlCommand("Select * from tbl_course", con);
MySqlDataReader reader = [Link]();
while ([Link]())
{
[Link]([Link]("courseID") + " " + reader
.GetString("courseName"));
}
[Link]();
}
private void dataGridView1_CellContentClick(object sender, DataGridViewC
ellEventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
MySqlDataAdapter adpt = new MySqlDataAdapter("select * from tbl_stud
ent where courseID=(Select courseID from tbl_course where courseID='" + ((comboB
[Link]).Split(' '))[0] + "');", con);
DataSet ds = new DataSet();
[Link](ds);
[Link] = [Link][0];
[Link]();
}
public void display()
{
MySqlDataAdapter adpt = new MySqlDataAdapter("select * from book", c
on);
DataSet ds = new DataSet();
[Link](ds);
[Link] = [Link][0];
[Link]();
}
}
}
particular_year.cs
---------------using System;
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
namespace student
{
public partial class particular_year : Form
{
MySqlConnection con = new MySqlConnection("server=localhost;database=1rz
14mca20;uid=root;pwd=mca");
MySqlCommand cmd;
public particular_year()
{
InitializeComponent();
[Link]();
cmd = new MySqlCommand("Select * from tbl_student group by yearadm",
con);
MySqlDataReader reader = [Link]();
while ([Link]())
{
[Link]([Link]("yearadm"));
}
[Link]();
}
private void button1_Click(object sender, EventArgs e)
{
MySqlDataAdapter adpt = new MySqlDataAdapter("(select * from tbl_stu
dent where yearadm= '" +[Link]+"');", con);
DataSet ds = new DataSet();
[Link](ds);
[Link] = [Link][0];
[Link]();
}
}
}
[Link]
--------using System;
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
namespace student
{
public partial class stud : Form
{
String connection = "Server=localhost;Database=1rz14mca20;Uid=root;Pwd=m
ca";
MySqlConnection con;
MySqlCommand cmd;
public stud()
{
InitializeComponent();
con = new MySqlConnection(connection);
[Link]();
cmd = new MySqlCommand("Select * from tbl_course", con);
MySqlDataReader reader = [Link]();
while ([Link]())
{
[Link]([Link]("courseID") + " " + reader
.GetString("courseName"));
}
[Link]();
[Link]();
}
private void Delete_Click(object sender, EventArgs e)
{
[Link]();
try
{
cmd = [Link]();
[Link] = "delete from tbl_student where usn=?usn";
[Link]();
[Link]("?usn", [Link]);
[Link]();
}
catch (Exception)
{
throw;
}
finally
{
[Link]();
[Link]();
[Link]();
[Link]();
//[Link]();
[Link]();
}
}
private void Add_Click(object sender, EventArgs e)
{
[Link]();
try
{
cmd = [Link]();
[Link] = "insert into tbl_student(usn,studName,address,
courseID,yearadm) values(?usn,?name,?address,?courseId,?yearofadm)";
[Link]();
[Link]("?usn", [Link]);
[Link]("?name", [Link]);
[Link]("?address", [Link]);
[Link]("?courseId", (([Link]).Split
(' '))[0]);
[Link]("?yearofadm", [Link]);
[Link]();
}
catch (Exception)
{
throw;
}
finally
{
[Link]();
[Link]();
[Link]();
[Link]();
//[Link]();
[Link]();
}
}
private void show_Click(object sender, EventArgs e)
{
[Link]();
MySqlDataAdapter adapter = new MySqlDataAdapter("select * from tbl_s
tudent", con);
DataSet ds = new DataSet();
[Link](ds, "c");
[Link] = [Link]["c"];
[Link]();
}
}
}