using System;
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
namespace RADproject1
{
public partial class DBtestform : Form
{
public DBtestform()
{
InitializeComponent();
}
private void DBtestform_Load(object sender, EventArgs e)
{
OleDbConnection con1 = new OleDbConnection();
[Link] =
@" Provider=[Link].12.0;
Data Source =D:\[Link];
Persist Security info =False;";
[Link]();
// if ([Link](true))
// {
// [Link]("connected");
// }
string str1 = "select * from stud;";
OleDbDataAdapter da = new
OleDbDataAdapter(str1, con1);
DataTable dt = new DataTable();
[Link](dt);
[Link] = dt;
private void button1_Click(object sender, EventArgs e)
{
[Link]("My first Message", "Message", [Link]);
private void button2_Click(object sender, EventArgs e)
{
OleDbConnection con1 = new OleDbConnection();
[Link] =
@" Provider=[Link].12.0;
Data Source =D:\[Link];
Persist Security info =False;";
[Link]();
private void button3_Click(object sender, EventArgs e)
{
string id = [Link]();
string name = [Link]();
string sex = [Link]();;
int Age = [Link]([Link]);
//int phone = [Link]([Link]);
OleDbConnection conn = new OleDbConnection();
[Link] =
@" Provider=[Link].12.0;
Data Source =D:\[Link];
Persist Security info =False;";
[Link]();
try
{
string qry = "Insert into stud values ('" + [Link] + "','" + [Link] + "', '" +
[Link] + "','" + [Link] + "','" + [Link] + "' );";
OleDbCommand result = new OleDbCommand(qry, conn);
[Link]();
[Link]("Data added successfully");
}
catch (DataException e1 )
{
[Link]("Error" + [Link]());
}
}
private void button6_Click(object sender, EventArgs e)
{
OleDbConnection con4 = new OleDbConnection();
[Link] =
@" Provider=[Link].12.0;
Data Source =D:\[Link];
Persist Security info =False;";
[Link]();
string str4 = "select * from stud where id='"+[Link]+"' ";
OleDbDataAdapter da4 = new OleDbDataAdapter(str4, con4);
DataTable dt4 = new DataTable();
[Link](dt4);
[Link] = dt4;
private void button4_Click(object sender, EventArgs e)
{
OleDbConnection conn = new OleDbConnection();
[Link] =
@" Provider=[Link].12.0;
Data Source =D:\[Link];
Persist Security info =False;";
[Link]();
try
{
string qry = "update stud set name= '" + [Link] + "', sex='" + [Link] + "',
age='" + [Link] + "' Where id ='" +[Link] +"';";
OleDbCommand result = new OleDbCommand(qry, conn);
[Link]();
[Link]("Data updated successfully");
}
catch ( ArgumentOutOfRangeException)
{
}
}
private void button5_Click(object sender, EventArgs e)
{
private void showFemalesToolStripMenuItem_Click(object sender, EventArgs e)
{
OleDbConnection con5 = new OleDbConnection();
[Link] =
@" Provider=[Link].12.0;
Data Source =D:\[Link];
Persist Security info =False;";
[Link]();
string str4 = "Select * from stud WHERE sex = 'F' ; ";
OleDbDataAdapter da5 = new OleDbDataAdapter(str4, con5);
DataTable dt5 = new DataTable();
[Link](dt5);
[Link] = dt5;
}
private void showMalesToolStripMenuItem_Click(object sender, EventArgs e)
{
OleDbConnection con5 = new OleDbConnection();
[Link] =
@" Provider=[Link].12.0;
Data Source =D:\[Link];
Persist Security info =False;";
[Link]();
string str4 = "Select * from stud WHERE sex = 'M' ; ";
OleDbDataAdapter da5 = new OleDbDataAdapter(str4, con5);
DataTable dt5 = new DataTable();
[Link](dt5);
[Link] = dt5;
}
private void localDBPageToolStripMenuItem_Click(object sender, EventArgs e)
{
local_dbpage ldp = new local_dbpage();
[Link]();
[Link]();
minmaxidentifier mm = new minmaxidentifier();
[Link]();
}
private void employeeReportToolStripMenuItem_Click(object sender, EventArgs e)
{
employeereportpage erp = new employeereportpage();
[Link]();
}
}
}