Click to See Complete Forum and Search --> : Strongly typed dataset combined with webservice


svollstad
February 24th, 2009, 05:00 AM
Hi

I'm using .Net 3.5 (for the record).

I am trying to create a program that connects to a MSSQL database either through a WebService that uses Ado.Net or directly via Ado.Net.

To try and minimize code usage, I put the part that connects to the database through Ado in a separate project, calling it CommonTypes. I am using a strongly typed dataset here.

I have then referenced both the program and the web service to this project and have no problem making either the web service or ado directly get information and printing it.

The problem here is that even though I have referenced to the same project in both main program and web service, I get different types, and as such can't treat them as the same type in the main program.
when using Ado directly i get the type: CommonTypes.StrongDataSet
and when I use the webservice i get: WebService.StrongDataSet

Am I going about this the wrong way? Or is there any solution to this problem?

zdavis
February 26th, 2009, 02:05 PM
I don't know if this helps....but check out the link below

http://www.tech-archive.net/Archive/DotNet/microsoft.public.dotnet.framework.aspnet.webservices/2007-03/msg00035.html

to the best of my knowledge you basically have the same strongly typed dataset but they exist in different assemblies/namespaces. If you can create a seperate assembly with the strongly typed datasets in that and then reference that assembly from both the webservice and your project you should be able to correct this error.

hope this helps

-zd

svollstad
March 3rd, 2009, 10:04 AM
OK. Thanks. I guess it makes sense somehow.
I didn't notice any remarkable changes in performance from ADO directly and going through the web service so I decided to just use the webservice connection.

Thanks for your help anyways :)