■ SQLiteCommand 클래스의 ExecuteNonQuery 메소드를 사용해 테이블을 삭제하는 방법을 보여준다.
▶ 예제 코드 (C#)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
using System; using System.Data.SQLite; string connectionString = "URI=file:c:\\test.db"; using(SQLiteConnection sqliteConnection = new SQLiteConnection(connectionString)) { sqliteConnection.Open(); using(SQLiteCommand sqliteCommand = new SQLiteCommand(sqliteConnection)) { sqliteCommand.CommandText = "DROP TABLE IF EXISTS Cars"; sqliteCommand.ExecuteNonQuery(); } sqliteConnection.Close(); } |