我创建了Winforms以备份我的数据库.然后,当我运行我的程序时,它给出了一个未处理的Win32Exception."系统找不到指定的文件"虽然该文件已经存在并导致该异常.
这是关于我的问题的代码
using System.Diagnostics;
private void btnProceed_Click(object sender, EventArgs e)
{
path = @"D:\MySQL\MySQL Server 5.5\bin\mysqldump.exe -u " + txtBoxDBUsername.Text + @" -p " + txtBoxDBName.Text + @" > D:\C#\Client\Salesmate - EMC\SalesMate\Backup\" + maskeTxtBoxDBFile.Text + @"";
Process p = new Process();
p.StartInfo.FileName = path;
p.Start();
}
Run Code Online (Sandbox Code Playgroud) 我已经仔细检查了我的SQL语句,似乎我的SQL语句是错误的.我不知道为什么它不起作用.我的SQL语句是正确的,这导致了这个OleDBException.
这是代码
public void updateAccount(Int32 accountid, String username, String password, String isdisable)
{
con.ConnectionString = db.konek();
String sql = "UPDATE accounts SET username = @username, password = @password, isdisable = @isdisable WHERE accountid = @accountid";
try
{
con.Open();
OleDbCommand cmd = new OleDbCommand(sql, con);
cmd.Parameters.AddWithValue("@username", username);
cmd.Parameters.AddWithValue("@password", password);
cmd.Parameters.AddWithValue("@isdisable", isdisable);
cmd.Parameters.AddWithValue("@accountid", accountid);
cmd.ExecuteNonQuery();
}
finally
{
con.Close();
}
}
Run Code Online (Sandbox Code Playgroud)
我的MS Access Table的屏幕截图

例外截图
