//no te olvides de..
using System.Data.OleDb;
using System.Data;
//----------------------------
public partial class Form1 : Form
{
OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\WindowsApplication2\\Base.mdb");
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
OleDbCommand cmd;
string Sql="INSERT INTO Persona (Nombre) VALUES ('" + this.textBox1.Text + "')";
try
{
con.Open();
cmd = new OleDbCommand(Sql,con);
cmd.ExecuteReader();
MessageBox.Show("Datos guardados");
}
catch
{
MessageBox.Show("Error al Guardar");
con.Close();
}
finally
{
con.Close();
}
}
}