error passing datetime parameter to webmethod

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chaitanya02
    New Member
    • May 2007
    • 46

    error passing datetime parameter to webmethod

    Hello All,

    Can anyone help me in passing a Datetime parameter to a webmethod, please?

    *declaration
    datetime datetime1;
    webmethod(out string datetime1);

    is it the right way of declaring a datetime variable..

    thanks,
    tanya
  • nateraaaa
    Recognized Expert Contributor
    • May 2007
    • 664

    #2
    I would pass the DateTime variable as a string. Then convert it back to a DateTime. XML does not handle DateTime variables very well. It would be much easier to pass the value as a string and convert it back to a DateTime.

    Nathan

    Comment

    Working...