When working with persistent layer in .NET environment, you feel something is needed like hibernate or ibatis as a data access layer which automatically makes relations between tables and object, and give us an opportunity to call stored procedures and queries like we call methods of an object. Although hibernate is ported into .NET version, i don't trust its performance and other issues because of why i don't know. Then i looked around for different solutions and found bingoo Typed Dataset. If you haven't used it or know it, you can have a quick check here; Using Strongly-Typed Data Access in Visual Studio 2005 and ASP.NET 2.0. It has many nice sides such as simplifying many things, lessening code size, fastening development time in persistent layer etc... I have implemented all my tables, stored procedures and views using this method. It was really fun to make them. Click, Next, Select Ding dang finish. And it works fine. But after some time, i begin to see the disadvantages and problems of it. So let me list these problems and warn you not to do the same mistakes i did.
- Database name change
You created your typed data access layer with wizards. It is okay. But it saves database name, db username information in XSS files, means when you try to deploy your application, you have to use the same database name in a production server. You cannot change the name of the database. Big problem it there is a database with the same name in our production table, or when you try to create two instance of the application which is not possible.
- Table structure change
It is common to change the database tables' structure depending on new requirements or because of the wrong analysis. Maybe we need to change the data type of a column of a table, or length or size of a column. So if you change the table's structure you have also to change your entire typed datasets which are related to that table, which is a big headache. Everytime you change table structure, you also need to change dataset. - Database username
I suggest you to create your tables and stored procedures under the name "dbo", not custom user. If you create your stored procedure as a "customuser.SelectProducts" instead of "dbo.SelectProducts", the username "customuser" is stored in XSS files of typed dataset. So you cannot change the user name of the database in any place in the future. Same problem again like "Database name change"
Finally, i want to say that i am writing these problems because i didn't find the solution myself. i will be glad if you share with us, if you know the way how to handle these problem.
Hope it help ;)
See Also;