Solved

Typed Dataset to Web Service

Posted on 2006-06-30
3
291 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
Comment Utility
BTW, we are using VB.NET (VS 2005)
0
 
LVL 8

Accepted Solution

by:
Shakti109 earned 500 total points
Comment Utility
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
Comment Utility
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
canBalance challenge 34 65
wefewf 2 42
parse convert xml feed to text (python) 2 28
index Out OF Range Exception error 4 27
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now