SQLLite c# Wrapper
-
Hi I am developing Windows Mobile Application using c#, SQLLite DataBase,I am using .NETWrapper for SQLLite, Iam able to Create Tables, but I wanted to create only once,How to check whether the Table is already created? I didnt find any samples in Website. Please help me Thanks
-
Hi I am developing Windows Mobile Application using c#, SQLLite DataBase,I am using .NETWrapper for SQLLite, Iam able to Create Tables, but I wanted to create only once,How to check whether the Table is already created? I didnt find any samples in Website. Please help me Thanks
Try "Select Count(*) from Mytable" If you get an exception (or no such table error) then create it, if it succeeds, then move on to the next table.
-
Try "Select Count(*) from Mytable" If you get an exception (or no such table error) then create it, if it succeeds, then move on to the next table.
Thanks for your prompt reply, I will try it out.
-
Hi I am developing Windows Mobile Application using c#, SQLLite DataBase,I am using .NETWrapper for SQLLite, Iam able to Create Tables, but I wanted to create only once,How to check whether the Table is already created? I didnt find any samples in Website. Please help me Thanks
-
Use Transact SQL.. Something like. IF 'USERS' NOT EXIST THEN CREATE TABLE ( ... ) Hopes his helps...
.NET Rules
'USERS' means what?
-
'USERS' means what?
Sorry.. typo mistake 'USERS' is the table.. Also if you are using an ms sql db, then you can also do something like this IF EXISTS (SELECT 1 FROM sysobjects WHERE xtype='u' AND name='tablename') --- 'tablename exists.' ELSE --- 'tablename does not exist.' Dropping Table DROP TABLE SALARY IF EXIST then create it again CREATE TABLE SALARY ( ... ) There are many ways to solve what you are trying to do..
.NET Rules