|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How can I do a comum DAL to access SQL, Oracle, Access, etcHi.
I want to develop a class (my Data Access Layer) to access all database what am I want (like Oracle, SQL Server, Access, MySQL) Someone did anything like that? Or know how can I do that? I hear something about Pet Shop 3 model access each Oracle than Sql Server. The model they are utilized were correct? Thanks. Fernando Lopes ADO.NET 2.0 has abstracted the data layer so that you can have a connection
object (or command object or etc...) that is database-independent. http://www.devx.com/dotnet/Article/27297/1954?pf=true Show quote "Fernando Lopes" <fernandomattarlopes@[remove]msn.com> wrote in message news:u2dr2nGNFHA.2580@TK2MSFTNGP09.phx.gbl... > Hi. > I want to develop a class (my Data Access Layer) to access all database > what > am I want (like Oracle, SQL Server, Access, MySQL) > > Someone did anything like that? Or know how can I do that? > I hear something about Pet Shop 3 model access each Oracle than Sql > Server. > The model they are utilized were correct? > > Thanks. > > Fernando Lopes > > Thanks Michael.
I know this on ado.net 2.0 But I'm using 1.1 Any other idea? Show quote "Michael Rodriguez" <mike@nospamforme.com> wrote in message news:ONzqpdHNFHA.3760@TK2MSFTNGP12.phx.gbl... > ADO.NET 2.0 has abstracted the data layer so that you can have a connection > object (or command object or etc...) that is database-independent. > > http://www.devx.com/dotnet/Article/27297/1954?pf=true > > > "Fernando Lopes" <fernandomattarlopes@[remove]msn.com> wrote in message > news:u2dr2nGNFHA.2580@TK2MSFTNGP09.phx.gbl... > > Hi. > > I want to develop a class (my Data Access Layer) to access all database > > what > > am I want (like Oracle, SQL Server, Access, MySQL) > > > > Someone did anything like that? Or know how can I do that? > > I hear something about Pet Shop 3 model access each Oracle than Sql > > Server. > > The model they are utilized were correct? > > > > Thanks. > > > > Fernando Lopes > > > > > > I have this exact same requirement for my Data Access Layer.
Check the Data Access Application Block 3.0 (Abstract Factory) They implement a "helper" class that will help you program with ADO.NET using the common interfaces. For instance this code uses the SQL Server provider: string providerType = "SqlServer"; AdoHelper helper = AdoHelper.CreateHelper(providerType); IDbConnection myConnection = helper.GetConnection(connString); IDbCommand myCommand = helper.CreateCommand(myConnection, "SELECT * FROM Customer"); If you wanted to use OleDb all you would need to do is change "SqlServer" by "OleDb", .. hence, you can take runtime decision on which provider to use, .. say according to a configuration file or register parameter etc... Hope this helps Show quote "Fernando Lopes" wrote: > Thanks Michael. > I know this on ado.net 2.0 > But I'm using 1.1 > > Any other idea? > > "Michael Rodriguez" <mike@nospamforme.com> wrote in message > news:ONzqpdHNFHA.3760@TK2MSFTNGP12.phx.gbl... > > ADO.NET 2.0 has abstracted the data layer so that you can have a > connection > > object (or command object or etc...) that is database-independent. > > > > http://www.devx.com/dotnet/Article/27297/1954?pf=true > > > > > > "Fernando Lopes" <fernandomattarlopes@[remove]msn.com> wrote in message > > news:u2dr2nGNFHA.2580@TK2MSFTNGP09.phx.gbl... > > > Hi. > > > I want to develop a class (my Data Access Layer) to access all database > > > what > > > am I want (like Oracle, SQL Server, Access, MySQL) > > > > > > Someone did anything like that? Or know how can I do that? > > > I hear something about Pet Shop 3 model access each Oracle than Sql > > > Server. > > > The model they are utilized were correct? > > > > > > Thanks. > > > > > > Fernando Lopes > > > > > > > > > > > > > |
|||||||||||||||||||||||