C#数据恢复出现的错误
代码如下:
private void 数据恢复ToolStripMenuItem_Click(object sender, EventArgs e)
{
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
this.label1.Visible = true;
this.label1.Refresh();
this.progressBar1.Visible = true;
this.groupBox1.Visible = true;
this.label1.Text = "进行数据库恢复中... ";
SQLDMO.SQLServer svr = new SQLDMO.SQLServerClass();
//try
//{
svr.Connect( "127.0.0.1 ", "sa ", " ");
//杀死所有有关的进程
SQLDMO.QueryResults qr = svr.EnumProcesses(-1);
int iColPIDNum = -1;
int iColDbName = -1;
for (int i = 1; i <= qr.Columns; i++)
{
string strName = qr.get_ColumnName(i);
if (strName.ToUpper().Trim() == "SPID ") iColPIDNum