Re: problem in reading DateTime from webservice

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



my code is somethign like this...

Employee E = WS.GetEmployess(<emp id>)
// Error: String was not recognized as a valid DateTime

DateTime is returned by one of the property of type Employee.
ie E.JoiningDate

The code fails when i call GetEmployess, So i cant use xmlConvert in
this case.


Also when I set value to E.JoiningDate and call CreatenewEmployee it
fails again ..
Employee E = new Employee();
E.JoiningDate = DateTime;
WS.CreatenewEmployee(E);
// error: Date value is of wrong type

Please let me know if you have any idea abt this. I need a soluiotn for
2nd problem(error: Date value is of wrong type) as its very urgent
now..

Please not that i cant touch webservice code.

-Thanks


Michael Nemtsev wrote:

Let me guess that you need to use XmlConvert.ToDateTime to get the DateTime
in the XML format.
If it doesn't help could you show a short but complete code demonstrating
the problem?


I'm facing an error:"String was not recognized as a valid DateTime"
whille accessing DateTime from webservice.

And when I try to set DateTime to the same webservice it fails with
error:"Date value is of wrong type"

it looks like xs:DateTime is not compatible with .Net DateType. Any
suggestions on how to fix this without touching the webservice (3rd
party webservice)?

--
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche

.



Relevant Pages

  • RE: Employee Training Help
    ... HireDate - DateTime ... CourseID - Autonumber - primary key ... I am creating an employee training database where I can run reports and ...
    (microsoft.public.access.tablesdbdesign)
  • Re: DateTime parameters in ADOQuery
    ... A field in the Access table defined as DateTime, I have the SQL in ADOQuery ... I found that it always return no employee. ... What datatype are your parameters and the dtNextMonthStocktakeDate variables? ... They should be DateTime datatypes if you are going to use parameters. ...
    (borland.public.delphi.database.ado)
  • RE: This is driving me crazy
    ... EmpID - Autonumber - Primary key ... StartDate - DateTime ... employee to Emp_Job and left join from Jobsite to Emp_Job. ...
    (microsoft.public.access.queries)
  • Re: Help joining several tables
    ... CREATE TABLE Calendar ... (cal_date DATETIME NOT NULL PRIMARY KEY, ... This will give you the status of each employee for each day in the ...
    (microsoft.public.sqlserver.programming)
  • Re: DateTime WebService Discrepancy.
    ... When the datetime is sent by the webservice, ... > Ofcourse I had not even though of just passing a string as a parameter ... > locally and cut out the call to the web service. ...
    (microsoft.public.dotnet.framework.compactframework)