public partial class EnterData : Form
{
OleDbConnection myconn=new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\Buddiez\Documents\Visual Studio 2010\Projects\working with databse\working with databse\database.accdb");
public EnterData()
{
InitializeComponent();
}
private void EnterData_Load(object sender, EventArgs e)
{
}
private void btn_Save_Click(object sender, EventArgs e)
{
string connString = string.Format("insert into test_database values('{0}','{1}','{2}','{3}','{4}')", Convert.ToInt32(txtsno.Text), txtName.Text, Convert.ToInt32(txtage.Text), txtBackground.Text, txtAddress.Text);
OleDbCommand myConn = new OleDbCommand(connString, myconn);
try
{
myconn.Open();
myConn.ExecuteNonQuery();
MessageBox.Show("Entry Updated");
myconn.Dispose();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
同じ問題 Microsoft.ACE.OLEDB.12.0 is not registered to local machine... ガイドしてください..