Esempio n. 1
0
        private void CreateDB()
        {
            SQLiteConnection conn = new SQLite_Android().GetConnection();

            conn.CreateTable <Phone>();
            conn.CreateTable <User>();
            conn.CreateTable <Contact>();
            conn.CreateTable <Group>();
            conn.CreateTable <ContactGroup>();

            List <SQLiteConnection.ColumnInfo> c = new List <SQLiteConnection.ColumnInfo>();

            c = conn.GetTableInfo("Phone");
            c = conn.GetTableInfo("User");
            c = conn.GetTableInfo("Contact");
            c = conn.GetTableInfo("Group");
            c = conn.GetTableInfo("ContactGroup");
            //
        }
Esempio n. 2
0
        public void DropDB()
        {
            SQLiteConnection conn = new SQLite_Android().GetConnection();
            //string dropUsersQuery = "DROP TABLE User";
            //SQLiteCommand dropUsersCommand = conn.CreateCommand(dropUsersQuery);
            //dropUsersCommand.ExecuteNonQuery();

            string        dropContactsQuery   = "DROP TABLE Contact";
            SQLiteCommand dropContactsCommand = conn.CreateCommand(dropContactsQuery);

            dropContactsCommand.ExecuteNonQuery();

            string        dropPhonesQuery   = "DROP TABLE Phone";
            SQLiteCommand dropPhonesCommand = conn.CreateCommand(dropPhonesQuery);

            dropPhonesCommand.ExecuteNonQuery();

            string        dropGroupsTable   = "DROP TABLE ContactGroup";
            SQLiteCommand dropGroupsCommand = conn.CreateCommand(dropGroupsTable);

            dropGroupsCommand.ExecuteNonQuery();
        }