OleDbConnection conn = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;" +
"Data Source=" + path +
"Persist Security Info=True");
OleDbCommand cmd = new OleDbCommand();
cmd.Connection = conn;
cmd.CommandType = CommandType.Text;
cmd.CommandText = "insert into Customer ( CustFName, CustLName, Address, Gender, Email, Phone, Organization) values ('" + fname_AC.Text + "','" + lname_AC.Text + "','" + address_AC.Text + "','" + gen_AC.Text +"','" + email_AC.Text + "','" + ph_AC.Text + "','" + org_AC.Text + "')";
conn.Open();
try
{
cmd.ExecuteNonQuery();
}
catch (Exception ex)
{
ex.Message.ToString();
}
finally
{
conn.Close();
cmd.Dispose();
}
答案 0 :(得分:0)
实际上正在更新的数据库位于bin文件夹中,我正在检查的数据库位于项目文件夹中