C# 数据库备份问题??
#region 备份
private void BeiFen()
{
try
{
string strg = Application.StartupPath.ToString();
strg = strg.Substring(0, strg.LastIndexOf("\"));
strg = strg.Substring(0, strg.LastIndexOf("\"));
strg += @"\Data";
string backSQL = @"BACKUP?DATABASE?jxc?TO?Disk='" + strg + "\" + "" + ".bak" + "'";
DbHelperSQL.ExecuteSql(backSQL);
if (MessageBox.Show("备份成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation) == DialogResult.OK)
{
this.Close();
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
#endregion