Any function that uses class which is not available on current platform,
will fail, once invoked, regardless of whether you actually execute the
lines that reference this class. Because of this the following won't work:
void test()
{
if(os == "WinCE")
{
SqlCeEngine eng = new SqlCeEngine()
...
}
else
{
// use mdb db
}
}
but this will:
void UseSqlCe()
{
SqlCeEngine eng = new SqlCeEngine()
...
}
void UseMDB()
{
....
}
void test()
{
if(os == "WinCE")
{
UseSqlCe();
}
else
{
UseMDB();
}
}
The problem is that you will end up with enormous amount of code. I have
written a class "SQLGenericClient", that uses SqlCe on WinCE and SQLClient
on the desktop. It offers SQLGEnericCommand, SQLGenericDataAdapter,
SQLGenericTransaction etc. While doing this I've hit a number of snags and
cannot say that I have reached production quality... The demo works though