Skip to content

Instantly share code, notes, and snippets.

@tuldok89
Created March 2, 2012 05:46
Show Gist options
  • Save tuldok89/1955981 to your computer and use it in GitHub Desktop.
Save tuldok89/1955981 to your computer and use it in GitHub Desktop.
Button
private void button1_Click(object sender, EventArgs e)
{
using (OleDbConnection vcon = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\JaYzoN\Documents\Visual Studio 2010\Projects\employee\employeefile.accdb"))
{
vcon.Open();
var vcom = vcon.CreateCommand();
vcom.CommandText = string.Format("insert into emp_details values('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}')", int.Parse(textBox1.Text), textBox2.Text, int.Parse(textBox3.Text), textBox4.Text, textBox5.Text, (textBox6.Text), textBox7.Text, textBox8.Text);
vcom.ExecuteNonQuery();
vcon.Close();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment