connection クラス : ExistsTable(string)メソッド
説明
テーブルが存在するかどうかを示す値を返します。
構文
instance.ExistsTable(string name)
引数
| クラス | 名前 | 説明 |
| string | name | テーブル名。 |
返り値
| クラス | 説明 |
| bool | テーブルが存在するかどうかを示す値。 |
サンプルコード
| 1: | connection cnn = new connection("Data Source=c:\somedirectory\somedatabase.sqlite3;Version=3;"); |
| 2: | cnn.Open(); |
| 3: | bool exists = cnn.ExistsTable("tabelname"); |
| 4: | cnn.Close(); |
| 5: | cnn.Release(); |
注意
以下のSQL文を実行して結果を bool で返します。
select count(*) from sqlite_master where type='table' and name='tablename';
参照リンク
無し。


