Thursday, February 15, 2007

Hello!

Long time no seen, yes I know...
It's because I am quite busy at work, we worked at full time job on a very large web project to one of the government offices, but this project is coming to its end.

Now, to our issue...
Firstable some words about the application architecture - the application is devided and built as N-Tier layers, every tier is isolated from the other and lives as a single and separate assembly (.dll).
The tiers are:

  • Entities Layer -  This layer holds and represents the entities of the application, for each database table there is an entity class which holds all its fields as properties by each field specification. This class is a Typed Dataset, that holds all the data and being generated automatically, in addition there is another class that represents a filter in purpose to hold values to filter if necessary.
  • Data Access Layer - Every entity class has a DAL class which implements the main CRUD (create, read, update and delete) methods against the database. For easyer and comfortable working, we are using the SqlHelper of Data Application Blocks v.2.0.
  • Business Logic Layer - This layer holds business logic classes that holds the flows of more comlpexed actions, like transactions, and a working with several tables.
  • Presentation Layer - This layer holds the presentation web pages. All the pages are AJAX fully supported to grant the user the best surfing experience.

OK, after I told you about the architecture I will approach the problem I bumped into.

When I wanted to fill my Typed DataSet using SqlHelper I thought to use the classic method:

UsersDS ds = SqlHelper.ExecuteDataset(con, CommandType.StoredProcedure, StoredProcedures.GetUserById, idParam);

But I encountered with a problem to fill the typed DataSet - UsersDS, this method knows to return a generic DataSet with no specification of the Typed DataSet and it was a problem (but little one... :))

The new change of the Data Application Blocks v.2.0 is that there is the ability of using FillDataSet method which knows to fill the exact Typed DataSet and DataTables that exists in it, and this is going like that:

SqlHelper.FillDataset(con, StoredProcedures.GetUserById, ds, new string[] { "E_Users" }, idParam);

Here, you must specify the Typed DataTable that exist in the Typed DataSet that you want to fill. As you see, we must send it via the method as a string's array, and by that you can send several tables to fill by sending their names.

That's it folks, as usually I will be glad to hear some additions and comments.

Posted by: Eran Nachum (c)
Post Date: 2/15/2007 10:48:22 AM (Jerusalem Standard Time, UTC+02:00)
Disclaimer | Comments [4] | Trackback   #