Cross Database Form Parameters

Hi,

The new database controls work well by permitting the ConnectionString provider name to be toggled based on the database, e.g. providerName="System.Data.SqlClient" or providerName="System.Data.OracleClient". Grids still work, selecting the data from the new database providing tables have the same names and the queries are generic SQL.

Unfortunately when you start using query parameters, the parameter names appear to be tied to the database used:

:parameter for Oracle and
parameter for SQL Server

What is the way around this Does there exist a cross database parameter format, or do we have to at runtime scan and replace our parameter prefixes which will be messy This seems like hard work given that SQLDataSource supports all the ADO databases...

Thanks!

RW.


Answer this question

Cross Database Form Parameters

  • cashinde

    The Parameter marking schemes are provider dependent so, not really. This is just the tip of the iceberg though. The SQL used in Oracle and SQL Server are different, the stored procedures are different and on and on. Creating a single application that can access both can be a big challenge.

  • SP_UK

    Thanks for the quick reply. It's amazing that such a basic thing as a query parameter cannot have a generic syntax in this day and age. Maybe an improvement for VS2007 :)

    Currently we have parameters in the form as ASP.NET tags that were filled in using the query builder. Do you have any recommendation on how those can be made to work

    Many thanks,

    RW

  • The Unknown P

    Ah, this has been a problem for decades. The various vendors each have their own special way of handling data (that's their added value). Don't expect this to change unless the Department of Homeland Security gets involved in an attempt to genericize the interfaces. ;)

    Of course, there's always a way to solve most any problem with code. I haven't seen any "good" solutions for this issue--just hacks of one kind or another.



  • Cross Database Form Parameters