connection class : ExistsTable(string) method
Description
Returns a value that indicates whether the table exists.
Syntax
instance.ExistsTable(string name)
Arguments
Class | Name | Description |
string | name | Table name. |
Return value
Class | Description |
bool | Whether the table exists. |
Sample code
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(); |
Notes
Executes the following SQL statement and returns the result as bool.
select count(*) from sqlite_master where type='table' and name='tablename';
Links for reference
None.