"M@" <mi@spiace.net> wrote in message
news:dn********************@twister1.libero.it...
Is possible to write a web form application
database-indipendent (using only SQL instructions...) ?
Yes, though it will need some careful planning first. Are you intending to
write a web app which will e.g. integrate into a customer's existing
intranet and interface with whatever backend RDBMS that customer has? If so,
I'm doing that very thing at the moment :-)
The way we do it is to have one single web application which provides the
GUI, plus several class libraries which provide the database integration.
Each of these class libraries has exactly the same interface and are,
essentially, a wrapper for the System.Data namespace.
When any of the class libraries is instantiated, a connection string (stored
encrypted in Web.config) is passed to it and then the particular method is
called. E.g. one of the most used functions in the class libraries is called
"FetchDataset(p_strSQL)". As you can imagine, it receives an SQL string (raw
or stored procedure), runs it against the specific RDBMS and returns a
System.Data.Dataset object back to the front-end. Another function is called
RunSQL(p_strSQL) which is used for writes to the underlying RDBMS and
returns an integer representing the number of rows affected by the write.
So far we have completed class libraries for SQL Server, Oracle and mySQL.
The next one will be whatever our next client uses... :-)