sql server - Where/How do I handle different connection types using Repository Pattern with ADO.Net? -


I'm new to the repository pattern, but building a repository to connect to two different database types I have those who have the same data structure.

  1. I will be connected to SQL Server 2005 and db2 (on iSeries)

    / li>

  2. I am using the repository in a WPF application.
  3. Although I want to use the unit framework, I can not. That's because IBM has imposed a good charge of $ 11,000 for a product called DB2 Connect, which will then give me access to my datacontext. Due to budget constraints, I am using ADOnate and using IDBCX interface.
  4. Why am I using two separate databases 1) Political, 2) Because our ERP system is based on AS-400 is very limited so I have to download my data to SQL Server and 3 ) Political

I have discussed all the tutorials on opening the connection within the call to the GetRecords () method. However, it is limiting me to a database.

  1. So, should I pass my connection object into my GetRecords method ?: GetRecords (MyIDbConnection)? It seems to restrict me if I decide to use XML (for whatever reason.)

  2. Within my GetRecords method, call me from the app needed. To get config connection string? Will this limit me if this repository is compiled in a .dll that does not have any app? Configure?

  3. Should I give a connection through Constructor instead?

  4. Can I use a data adapter?

Please advise.

Thank you.

You can use the pattern to provide a general way for the repository to be combined with the repository pattern You may want to consider communicating with the Data Access Layer. The gateway will provide a standard, platform-agnostic interface that does not require a repository to know something about the data source and its related APIs. You can present an example of a gateway in your repository using the Data Framework. This will help you control which types of gateways are transported through the repository of your central contents through the configuration strategy.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -