예제 #1
0
    private void SelectTable(string table_name, int keyvalue, out string[] strData, string keyfiled = "TableIndex")
    {
        DbAccess db = new DbAccess(dbName);
        SqliteDataReader SqliteReader = db.SelectTable(table_name, keyfiled, keyvalue);
        object[] objData = new object[SqliteReader.FieldCount];

        int fieldCount = SqliteReader.GetValues(objData);
        strData = new string[fieldCount];
        for (int i = 0; i < fieldCount; i++)
        {
            strData[i] = objData[i].ToString();
        }
        db.DisConnectDb();
    }
예제 #2
0
 private void SelectTable(string table_name, string item, out string[] strData)
 {
     DbAccess db = new DbAccess(dbName);
     SqliteDataReader SqliteReader = db.SelectTable(table_name);
     strData = new string[4];
     if (SqliteReader.HasRows)
     {
         while (SqliteReader.Read())
         {
             object[] objData = new object[SqliteReader.FieldCount];
             int fieldCount = SqliteReader.GetValues(objData);
             strData[int.Parse(objData[0].ToString())] = objData[2].ToString();
         }
     }
     db.DisConnectDb();
 }