![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
All, I have a webservice webmethod which does returns a strongly typed dataset called MyStronglyTypedDataSet correctly. On the client side, when I cast the dataset to my strongly typed dataset, it throws the following error "Cannot convert type ClientConsumer.localhost.MyStronglyTypedDataSet" to "MyNameSpace.WebServices.MyStronglyTypedDataSe t' If I cast it as a regular dataset on client side, it works fine, but that defeats the whole purpose of having strongly typed DS in first place. I am using a web reference from the client application to the web service, and also reference to the StronglyTpedDataSet dll that I created using SDK Command Prompt What am I doing wrong? |
#3
| |||
| |||
|
|
All, I have a webservice webmethod which does returns a strongly typed dataset called MyStronglyTypedDataSet correctly. On the client side, when I cast the dataset to my strongly typed dataset, it throws the following error "Cannot convert type ClientConsumer.localhost.MyStronglyTypedDataSet" to "MyNameSpace.WebServices.MyStronglyTypedDataSe t' If I cast it as a regular dataset on client side, it works fine, but that defeats the whole purpose of having strongly typed DS in first place. I am using a web reference from the client application to the web service, and also reference to the StronglyTpedDataSet dll that I created using SDK Command Prompt What am I doing wrong? |
#4
| |||
| |||
|
|
All, I have a webservice webmethod which does returns a strongly typed dataset called MyStronglyTypedDataSet correctly. On the client side, when I cast the dataset to my strongly typed dataset, it throws the following error "Cannot convert type ClientConsumer.localhost.MyStronglyTypedDataSet" to "MyNameSpace.WebServices.MyStronglyTypedDataSe t' If I cast it as a regular dataset on client side, it works fine, but that defeats the whole purpose of having strongly typed DS in first place. I am using a web reference from the client application to the web service, and also reference to the StronglyTpedDataSet dll that I created using SDK Command Prompt What am I doing wrong? |
#5
| |||
| |||
|
|
N. Shehzad, The main reason for the problem is that you are bundling the TypedDataset into an class library (dll). Please do not package the TypedDataset into an assembly. If you do that, you will end-up in the namespace conflicts. Try using the .xsd for TypedDataset at the Webservice side and the Client Side. I've used .xsd (instead of bundling .xsd inside assembly), it works. I could able to successfully pass the TypedDataset back-and-forth between webservice and client. Please let me know if this helps -- Thanks & Regards, Sundar Narasiman "N. Shehzad" wrote: All, I have a webservice webmethod which does returns a strongly typed dataset called MyStronglyTypedDataSet correctly. On the client side, when I cast the dataset to my strongly typed dataset, it throws the following error "Cannot convert type ClientConsumer.localhost.MyStronglyTypedDataSet" to "MyNameSpace.WebServices.MyStronglyTypedDataSe t' If I cast it as a regular dataset on client side, it works fine, but that defeats the whole purpose of having strongly typed DS in first place. I am using a web reference from the client application to the web service, and also reference to the StronglyTpedDataSet dll that I created using SDK Command Prompt What am I doing wrong? |
#6
| |||
| |||
|
|
Hi Sundar, I did create an .xsd schema first, and created a class file for that xsd schema using SDK Command prompt. How would I reference that class on the client side if I do not create a .dll library. Do I need to include that class on the client project as well? |
#7
| |||
| |||
|
|
"N. Shehzad" <NShehzad (AT) discussions (DOT) microsoft.com> wrote in message news:65D9D99F-99A5-47A5-BFAB-3CF4EE2034EC (AT) microsoft (DOT) com... Hi Sundar, I did create an .xsd schema first, and created a class file for that xsd schema using SDK Command prompt. How would I reference that class on the client side if I do not create a .dll library. Do I need to include that class on the client project as well? You don't need to do _anything_ to reference the class on the client side. Simply define your web service to return the strongly-typed dataset. Then use Add Web Reference in your client application to cause VS.NET to create the necessary proxy classes. One of those classes will be a client-side version of the server-side dataset. You will use that class on the client side. You will _never_ reference server-side classes on the client side. NEVER. John |
#8
| |||
| |||
|
|
John, The problem is it does not create those client proxy classes for the dataset. When I add the web reference, it only creates the localhost reference that's all |
#9
| |||
| |||
|
|
"N. Shehzad" <NShehzad (AT) discussions (DOT) microsoft.com> wrote in message news:65D9D99F-99A5-47A5-BFAB-3CF4EE2034EC (AT) microsoft (DOT) com... Hi Sundar, I did create an .xsd schema first, and created a class file for that xsd schema using SDK Command prompt. How would I reference that class on the client side if I do not create a .dll library. Do I need to include that class on the client project as well? You don't need to do _anything_ to reference the class on the client side. Simply define your web service to return the strongly-typed dataset. Then use Add Web Reference in your client application to cause VS.NET to create the necessary proxy classes. One of those classes will be a client-side version of the server-side dataset. You will use that class on the client side. You will _never_ reference server-side classes on the client side. NEVER. John |
#10
| |||
| |||
|
|
Actually, I got it to work with one dataset, but if my webservice has multiple typed datasets, they do not show up as proxy xsd when I create or update the web reference. |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |