public partial class Form1 : Form { OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Users\\SR050\\Documents\\VisitingCard.accdb"); public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { } private void button1_Click(object sender, EventArgs e) { con.Open(); OleDbCommand cmd = new OleDbCommand("VisitingCard_Insert", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Names", textBox1.Text); cmd.Parameters.AddWithValue("@Organization", textBox2.Text); cmd.Parameters.AddWithValue("@Location", textBox3.Text); cmd.Parameters.AddWithValue("@PhoneNo", textBox4.Text); cmd.Parameters.AddWithValue("@EmailId", textBox5.Text); int result = cmd.ExecuteNonQuery(); con.Close(); if (result > 0) { MessageBox.Show("Inserted Successfully"); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)