Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6131201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:56:48+00:00 2026-05-23T16:56:48+00:00

I worked now in a dynamic ASP.NET C# web application that connects to a

  • 0

I worked now in a dynamic ASP.NET C# web application that connects to a Sybase database using ODBC and my main problem is the conversion between datetime and string data types in my application.

The database saves the datetime data in the following form:-

7/11/2011 05:05:05
I think it is in the pattern of "MM/dd/yyyy hh:mm:ss"

I need to call a web service and pass some datetime parameters to get the correct output.
The static datetime format that is accepted by the web service is:-

11/07/11 09:09:09
I think it is in the pattern of "dd/MM/yy hh:mm:ss"

I tried using the following functions separately

string s = d.toString(string format)
DateTime d = Convert.ToDateTime(string s)
DateTime d = s.Datetime.Parse(string format)
DateTime d = s.Datetime.ParseExact(string format)

to convert the dates I got from the database to be suitable to be passed to the web service but it always gives me different exceptions like:-

Exception:System.FormatException: String was not recognized as a valid DateTime. at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles) at System.DateTime.Parse(String s) at WebApplication1.WebForm1.callWebservice()

I do not know how I should use and convert dates in the proper way and I get disappointed as I try many examples and functions but I can not get the right methodlogy.

I hope that I find someone who could help and Thanks in advance…..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T16:56:48+00:00Added an answer on May 23, 2026 at 4:56 pm

    follow the link, there’s everything about DateTime Formatting:

    http://www.csharp-examples.net/string-format-datetime/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've developed a web application that worked fine in JBoss 4. Now, I need
I have worked a bit with ASP.NET before. I was using a MS SQL
I'm writing an ASP.Net MVC application using Jquery to post some data to my
I am trying to learn on Web Application security. I worked with tools that
I have now worked on two different teams that use the Agile/Scrum approach in
I have a graphical control that is multithreaded. Until now it worked fine, but
Having worked with Classic ASP for about 2 years now by creating a few
The script below worked on my Mac OS X. I'm now using Ubuntu OS,
I have a .net 4.0 web application hosted on IIS7 server. After reading this:
I previously worked a lot with Java and now I am working more with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.