使用SQLite

时间:2018-06-09 22:46:30

标签: c# sqlite unity3d

如何使用sql显示当前数据库中的所有表?现在我只是想计算数据库中表的数量,但我想要做的是列出所有表名并将它们写入新列表。

public void UpdateListData(string driftID)
    {
        // string sql = "SELECT * FROM \"" + driftID + "\" ";
        // GameManager.Drift = dbManager.Query<Drift>(sql);    // Write Query to List

        string dbName = dbManager.workingName;
        Debug.Log(dbManager.workingName);

        string sql = "SELECT name FROM Drifts.sqlite WHERE type = 'table'";
        GameManager.Drifts.Add(dbManager.Query<Drift>(sql));

        foreach (List<Drift> drift in GameManager.Drifts)
        {
            numDriftSets++;
        }

        Debug.Log("There are " + numDriftSets + "drift sets in the list.");

        // Debug.Log("The current item count is : " + GameManager.Drift.Count);
        // Debug.Log("LIST TEST : " + GameManager.Drift[1].DriftStep);
    }

0 个答案:

没有答案