Write your code without regard to the database that it will use.
WIDatabase is a .NET 3.5 library that simplifies the use of databases from Microsoft SQL, MySql and SqLite.This library isolates the developer from the nuances associated with moving between database types.We feel that a software developer should not care if an integer is stored as 64 or 32 bit or as text. Additionally, the need to learn the idiosyncrasies of SQL for each database type impedes the core task of a software developer.
WIDatabase improves time to market by allowing one version of source code to be used with different databases with the simple flip of a software switch. This does not mean that functionality is missing. Advanced users can still utilize the SQL Language if desired, but much of that need has been eliminated.
1) Code is written once without regard to which database you are using.
Once written, to change database types all that needs to be done is change
the constructor. For example:
/* To connect to a SQLite Database */
WIDB = new WIDatabase("c:\\Sqlite.db3");
/* To connect to a Microsoft SQL Database */
DBInfo = new CDatabaseInfo();
DBInfo.DatabaseType = eDatabaseType.SQL;
DBInfo.Location = "SqlServer";
DBInfo.DBName = "TestDatabase";
DBInfo.Username = "LoginName";
DBInfo.Password = "LoginPassword";
WIDB = new WIDatabase(DBInfo);
2) As you can from the below sample code, knownledge of SQL syntax is not
required unless advanced features are needed.
/* Simple example to search table 'tblPeople' returning data in columns */
/* 'FirstName' & 'LastName' */
string First, Last;
WIDB = new WIDatabase("c:\\Sqlite.db3"); /* Open SQLite Database */
WIDB.Search.Table("tblPeople"); /* Search Table 'tblPeople' */
WIDB.Search.Column("FirstName"); /* Request data in columns */
WIDB.Search.Column("LastName"); /* 'FirstName' & 'LastName' */
WIDB.Search.Execute(); /* Perform search request */
while(WIDB.Search.Read()) /* Loop though results */
WIDB.Search.Get("LastName", out Last); /* Get data in 'LastName' */
WIDB.Search.Get("FirstName", out First); /* Get data in 'FirstName' */
WIDB.Close(); /* Close Database */
3) Common formatting errors with SQL syntax no longer exist since column
requests/inserts/updates are not required to be in order.