Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
DotNet
acad.assignment.mngr
academic
adonet
aspnet
aspnet.announcements
aspnet.build.controls
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
clr
compactframework
component_services
datatools
distributed_apps
drawing
faqs
framework
framework.wmi
general
internationalization
interop
languages.csharp
languages.jscript
languages.vb
languages.vb.controls
languages.vb.data
languages.vb.upgrade
languages.vc
languages.vc.libraries
myservices
odbcnet
performance
remoting
scripting
sdk
security
setup
vjsharp
vsa
webservi.enhancements
webservices
windowsforms
windowsforms.controls
winforms.databinding
winforms.designtime
xml
  
 
date: Fri, 20 Jun 2008 10:00:00 -0700,    group: microsoft.public.dotnet.framework.aspnet.webservices        back       


Web Method Signature throwing ArgumentException   
Hi,

If I create Web Method with input parameter datatypes other than strings 
then the Web Method pukes with a "System.ArgumentException Can't convert to 
DateTime" when the field is left blank.
e.g public string myWebMethod(DateTime StartDate)

Is there a way to trap and handle this exception. Does this confine 
developers to only writing Methods with input parameters as Strings.

Someones experience appreciated


-- 
Regards

Gordon
date: Fri, 20 Jun 2008 10:00:00 -0700   author:   Gordon

Re: Web Method Signature throwing ArgumentException   
On Jun 20, 11:00 pm, Gordon  wrote:
> Hi,
>
> If I create Web Method with input parameter datatypes other than strings
> then the Web Method pukes with a "System.ArgumentException Can't convert to
> DateTime" when the field is left blank.
> e.g public string myWebMethod(DateTime StartDate)
>
> Is there a way to trap and handle this exception. Does this confine
> developers to only writing Methods with input parameters as Strings.
>
> Someones experience appreciated
>
> --
> Regards
>
> Gordon


Hi Gordon

You cannot pass null/empty. You can pass DateTime.MinValue to
determine the intention of leaving this field empty.

Tanzim Saqib
http://www.TanzimSaqib.com
date: Wed, 2 Jul 2008 01:45:39 -0700 (PDT)   author:   Tanzim Saqib

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us