How to pass typed dataset objects using web services

211 views Asked by At

I have a C# Winform application (.Net 3.5) which access a MSSQL server using typed DataSet objects.

currently, my whole application is working in one layer, and the client access directly to the DB using those typed DataSet objects.

I want to change my application to client-server model (which will use web-services for communication).

My question is: How can I pass typed DataSet objects in the web-services? For example, I have a table of persons. And I want my client side to be able to get specific person (using web-service), update its age, and save the change (again using web service).

Is it possible?

Thanks

2

There are 2 answers

0
ballBreaker On BEST ANSWER

You should try something out like Hibernate. Which is an intermediate entity-based mapping between classes and database tables. The queries would be performed on the business side of the application (web service in your case) in the HQL language; which is very similar to regular SQL. I've personally used it multiple times with Java and it can be quite useful. Doing a brief internet search I found "NHibernate" which is a .NET specific version for Hibernate.

For my specific Java application, it is set up such that the GUI is not on the web-service, while basically everything else is. Then using a resource manager, created a "link" which pointed at the business side. All transactions were performed on the web-service, while they were being displayed on the client side.

So to answer your question; yes it is entirely possible.

0
Solomon Rutzky On

Since you are using .Net, you should at least check out Entity Framework (the .Net ORM) prior to going with the 3rd party nHibernate. nHibernate might be fine, and might be the way to go, but you should at least compare it to Entity Framework first and have a reason for not using Entity Framework.