using [Link].
OleDb;
public partial class Form1 : Form
{
OleDbConnection vcon = new
OleDbConnection(@"Provider=[Link].12.0;Data Source=D:\[Link]");
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e) //View
{
string s1 = "select * from [t1]";
OleDbCommand vcomm = new OleDbCommand(s1, vcon);
DataSet vds = new DataSet();
OleDbDataAdapter vda = new OleDbDataAdapter(vcomm);
[Link](vds, "res");
[Link] = [Link]["res"];
[Link]();
[Link]();
private void Form1_Load(object sender, EventArgs e)
{
[Link]();
}
private void Add_Click(object sender, EventArgs e) // Insert
{
string vsql = [Link]("insert into [t1] values('{0}','{1}')",
[Link], [Link]);
OleDbCommand vcomm = new OleDbCommand(vsql, vcon);
[Link]();
[Link]("Added successful");
[Link]();
private void button2_Click(object sender, EventArgs e) //Search
{
string s2 = [Link]("select * from [t1] where [no]='{0}'",
[Link]);
//string s2 = "select * from Order where Roll_No='1010'";
OleDbCommand vcom = new OleDbCommand(s2, vcon);
DataSet vd = new DataSet();
OleDbDataAdapter vdap = new OleDbDataAdapter(vcom);
[Link](vd, "res");
[Link] = [Link]["res"];
[Link]();
[Link]();
}
}
} Database Name:db ----- Table Name:t1