Exemple #1
0
        public void AddPhoneWork(PhoneInfo pi)
        {
            SQLiteCommand com = connect.CreateCommand();

            com.CommandText = "INSERT INTO phones (phone, country) VALUES ('" + pi.phone + "','" + pi.country + "');";
            com.ExecuteNonQuery();
        }
Exemple #2
0
        public PhoneInfo GetPhoneWork(string phone)
        {
            PhoneInfo     pi  = null;
            SQLiteCommand com = connect.CreateCommand();

            com.CommandText = "SELECT * FROM phones WHERE phone LIKE '" + phone + "';";
            SQLiteDataReader dr = com.ExecuteReader();

            while (dr.Read())
            {
                pi = new PhoneInfo()
                {
                    phone   = dr["phone"].ToString(),
                    country = dr["country"].ToString()
                };
            }
            return(pi);
        }