If you store your query string in a Shared method of a class you can
retrieve it by the method name (and use any parameters you might need.). You
could also pass in the DBtype (or read it from config) and the return a
different string from the same method for the other DB type. If the syntax
is identical you just return the same string.
e.g.
Public Shared Function GetMySQL() As String
Return "SELECT fld1 FROM table1"
End Sub
Public Shared Function GetMySpecialSQL(DBType As String) As String
If DBType="SQL Server" Then
Return "SELECT Top1 fld1 FROM table1"
ElseIfDBType="Oracle" Then
Return "SELECT fld1 FROM table1 WHERE rownum=1"
End If
End Sub
--
Joe Fallon
"Quentin Huo" <q.***@manyworlds.com> wrote in message
news:u9***************@TK2MSFTNGP15.phx.gbl...
Hi:
If I have a query string for retrieving data from SQL Server database, is
there a way to transfer it to a query string for retrieving data from
Oracle or any other database like mySQL...? I mean by a program. I am
working on C#.
Thanks
Q.