I would like to write all data relations processes (general functions regarding with DataAccess via .NET) in dll and I want to use it repeatedly. What kinds of functions should have in that dll? Some want to use Stored Procedures , Some with Statements. Can you all suggest me? Please guide me! Thanks all!
I would like to write all data relations processes (general functions regarding with DataAccess
Share
Microsoft Enterprise Library, using the Data Access Application Block should do what you need. It is a Framework for itself.
Another interesting Data Access library is the well known ORM NHibernate.
If you want to speed your DAL development, you ought to consider these two either individually or used together.
The EntLib DAAB will allow you to provide named connectionString into your application configuration file(s) so that you won’t need to deploy a new build of your application upon connectionString change, only the config file. It is also common practice to manage and configure only one connectionString per configuration file, so if one only connection string changes, you only deploy this new configuration file for this connection, and you’re done! EntLib allows you to manage your connection pool according to the best practices. Everything and all through quite simple XML configuration files.
As for NHibernate, it is an object/relational mapping tool which can handle the data access for you through the ISession API. All you need to concentrate on is developing your business class diagram. Once you’re done, just write the XML mapping files by respect to your object model, then you’re all set to persist your objects into the underlying datastore, whatever datastore you use. While using the SchemaExportTool, you may even don’t bother writing the DDL scripts, as NHibernate can create your relational schema for you!
As I said, either one or both, these are DAL layer for themselves, and much much more! Don’t bother wrapping them into another class library, unless you want to build a user-friendly tool for DAL. And they are 100% resusable! Isn’t it nice?