Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. DateTime Conversion error

DateTime Conversion error

Scheduled Pinned Locked Moved ASP.NET
databasesql-serversysadminhelp
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    Gymnast
    wrote on last edited by
    #1

    I am trying to retrieve the time from TableB into TableA. All it does is post the current date in the format...9/30/2007 0:00:00 What I am looking for is the time value in TableB. Here is my code..

    I have made sure the datatypes in the SQL Server database matches in both the Tables.

    Let me know why this is failing.

    Thanks,

    Gym

    S 1 Reply Last reply
    0
    • G Gymnast

      I am trying to retrieve the time from TableB into TableA. All it does is post the current date in the format...9/30/2007 0:00:00 What I am looking for is the time value in TableB. Here is my code..

      I have made sure the datatypes in the SQL Server database matches in both the Tables.

      Let me know why this is failing.

      Thanks,

      Gym

      S Offline
      S Offline
      Scott Dorman
      wrote on last edited by
      #2

      What is the value of startDateTextBox? Does it contain a full date and time? You might be better off storing the entire thing as a single column that holds both the start date and time or storing just the start date and the time as an offset from midnight. What was the error you got when you tried the Convert.ToDateTime call?

      Scott.


      —In just two days, tomorrow will be yesterday. [Forum Guidelines] [Articles] [Blog]

      G 1 Reply Last reply
      0
      • S Scott Dorman

        What is the value of startDateTextBox? Does it contain a full date and time? You might be better off storing the entire thing as a single column that holds both the start date and time or storing just the start date and the time as an offset from midnight. What was the error you got when you tried the Convert.ToDateTime call?

        Scott.


        —In just two days, tomorrow will be yesterday. [Forum Guidelines] [Articles] [Blog]

        G Offline
        G Offline
        Gymnast
        wrote on last edited by
        #3

        I finally got the textbox to work but when I use the same value to populate a dropdown list, it does not work. Actually, it works the first time around and after that there is apparently a postback issue. Because the page does not refresh itself and I am not able to figure out how to get that to happen. Also, there is no error message as such. In a different context, an error message in the form of a warning appears indicating an "Object instance not used" in line 290. What I don't understand to begin with, is the place to find 290 lines of code!! I couldn't find it even among the designer-gen code.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups