?
Solved

Typed Dataset to Web Service

Posted on 2006-06-30
3
Medium Priority
?
331 Views
Last Modified: 2010-04-17
A co-worker has written a moderately sized application.
The application was written to use strongly typed datasets.

Now, however, he has been asked to use a web service to access the database, and not to directly touch the DB. He has the ability to write the web service any way he wants, so long as it is the only means to access the database through the application.

He has a very short amount of time to fix this and has askd me to help. I'm not sure of the best way of doing this without having to modify a LOT of his code. Since I haven't any experience with this type of problem, I'm hoping someone out there knows of an easier way of making the switch.

Looking for fresh ideas.


Thanks,
Tony
0
Comment
Question by:mytonytiger
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 5

Author Comment

by:mytonytiger
ID: 17018340
BTW, we are using VB.NET (VS 2005)
0
 
LVL 8

Accepted Solution

by:
Shakti109 earned 2000 total points
ID: 17018495
All that needs to happen is to replace any data access methods wtih method calls
from the webservice, (after the webservice is added as a reference of course).

Example :

Old method using direct access (and ADO):

         CMD.CommandText = DB_cmd_String
         CNN.Open()
         CMD.ActiveConnection = CNN
         RST = CMD.Execute

New method using web-service method (called getdataset)

  dim oWs as new (insert webservice name here)
  dim rpt_data  as new dataset
  rpt_data =  ows.getdataset (query parameters)


Essentially, you modify your central data-access function(s) to call out to the web-service method instead of direct ADO (or whatever other type).

I am hoping the application was written using a central set of data-access functions that are then called from various locations ( I.E :  DB.getdataset, DB.ExecuteSproc, etc). This is very fast and easy, with not much code to modify.

If this is not the case then the first thing to do would be write a central data-access module and put all of the commonly used functions in it, then go back and reference that in the code. This will of course take lots more time and require more effort.

The web-service itself is just a very simple wrapper to a set of defined functions, it can be written to return just about any kind of object he needs (including datasets).
0
 
LVL 5

Author Comment

by:mytonytiger
ID: 17074152
sorry for the delay, I was out of the office last week and neglected to get back to this topic.

What you have suggested seems to be the only way and we have already started to make the modifications. I was hoping to find an alternative solution though. It will require modifying a LOT of his code since he did not create a Data Access layer. He's fairly fresh out of college and this kind of thing happens sometimes. I bet he doesn't do it again though. ;)

Thanks,
Tony
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
Make the most of your online learning experience.
Progress
Introduction to Processes

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question