DataTable ListAllTables(string filePath, string userID, string psw)
{
string strConnection = string.Format("Data source={0}", filePath);
SQLiteConnection myConnection = new SQLiteConnection(strConnection);
SQLiteCommand myCommand = new SQLiteCommand(myConnection);
myCommand.CommandText = "SELECT * FROM sqlite_master WHERE type='table'";
try
{
myConnection.Open();
DataTable table = new DataTable();
table.Load(myCommand.ExecuteReader());
return table;
}
catch { return null; }
finally { myConnection.Close(); }
}
沒有留言:
張貼留言