コード例 #1
0
        public Acronym CreateAcronym(Acronym ac)
        {
            string sql = "INSERT INTO AcronymTable (Acronym, Acronym_Meaning, Description) Values ('" + ac._abb + "', '" + ac._me + "', '" + ac._de + "');";

            using (SQLiteConnection myConnection = new SQLiteConnection(GlobalConnections.CnnString("AlgotecAcronymGuide")))
            {
                using (SQLiteCommand cmd = new SQLiteCommand(myConnection))
                {
                    myConnection.Open();
                    cmd.CommandText = sql;
                    cmd.ExecuteNonQuery();
                    //cmd.CommandText = "SELECT * FROM AcronymTable;";
                    //using (SQLiteDataReader reader = cmd.ExecuteReader())
                    //{
                    //    while (reader.Read())
                    //    {
                    //        Console.WriteLine("Acronym - {0}, Meaning - {1}, Description - {2}", reader["Acronym"], reader["Acronym_Meaning"], reader["Description"]);
                    //    }
                    //}
                }
            }
            return(null);
        }
コード例 #2
0
 public Acronym CreateAcronym(Acronym ac)
 {
     return(ac);
 }