sqlstr += "select * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0','" + AccessPath + "';'admin';'',Score)";
SqlConnection conn = CreateSQLCon();
conn.Open();
SqlCommand mycom = new SqlCommand(sqlstr, conn);
mycom.ExecuteNonQuery();//执行添加操作
if (j == DT.Rows.Count - 1)
{
Label1.Visible = true;
Label1.Text = "<script language=javascript>alert('数据导入成功.');location='AccessToSQL.aspx';</script>";
}
else
{
Label1.Visible = true;
Label1.Text = "<script language=javascript>alert('数据导入失败.');location='AccessToSQL.aspx';</script>";
}
conn.Close();
}
}
}
public void AccessLoadData()
{
OleDbConnection myConn = CreateCon();
myConn.Open(); //打开数据链接,得到一个数据集
DataSet myDataSet = new DataSet(); //创建DataSet对象
string StrSql = "select * from Score";
OleDbDataAdapter myCommand = new OleDbDataAdapter(StrSql, myConn);
myCommand.Fill(myDataSet, "Score");








