public void AddPhoneWork(PhoneInfo pi) { SQLiteCommand com = connect.CreateCommand(); com.CommandText = "INSERT INTO phones (phone, country) VALUES ('" + pi.phone + "','" + pi.country + "');"; com.ExecuteNonQuery(); }
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); }