Solved

Typed Dataset to Web Service

Posted on 2006-06-30
3
316 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
  • 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 500 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

Suggested Solutions

Title # Comments Views Activity
C# DataGridView_RowsAdded event not firing 1 82
Query Syntax 17 43
jboss 7.1 start up error 1 40
WordPress: Debugging from my Windows 10 Desktop 6 38
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
A short article about a problem I had getting the GPS LocationListener working.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

831 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