Solved

Typed Dataset to Web Service

Posted on 2006-06-30
3
299 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
word0 challenge 4 66
Path of Workbook 3 61
PHP question(s) about order of output 9 57
T-SQL:  Sigh---Boy, this is fun.... 12 34
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
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 fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

861 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

25 Experts available now in Live!

Get 1:1 Help Now