我有一个关于 ADOX 的错误,我不知道如何解决。
enter code here public static string[] GetTableExcel(string strFileName)
{
string[] strTables = new string[100];
Catalog sCatalog = new Catalog();
ADOX.Table sTable = new ADOX.Table();
MySql.Data.MySqlClient.MySqlConnection sConn = new MySql.Data.MySqlClient.MySqlConnection();
sConn.Open("server=localhost; Data Source = " + strFileName + ";user id=root;Password=1;database=test;persist security info=False");
sCatalog.ActiveConnection = sConn;
if (sCatalog.Tables.Count > 0)
{
int item = 0;
foreach (ADOX.Table tab in sCatalog.Tables)
{
if (tab.Type == "TABLE")
{
strTables[item] = tab.Name;
item++;
}
}
}
return strTables;
所述错误是“方法'Open'没有重载需要一个参数。这里有好心人能帮帮我吗?谢谢