2013-03-20 101 views
3
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); 
     } 
    } 

我已經配置了配置管理器的任何CPU甚至比IM面臨同樣的問題Microsoft.ACE.OLEDB.12.0沒有被註冊到本地機器..引導我..Microsoft.ACE.OLEDB.12.0沒有被註冊到本地機器

回答

4

聽起來就像你需要安裝Microsoft Access數據庫引擎2010可再發行組件。這將安裝所有必需的依賴項,以使Access OLEDB驅動程序正常工作。

You can get it here.

+0

感謝名單我知道了// – rummykhan 2013-03-20 16:23:35

相關問題