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. Could you please give me your advice

Could you please give me your advice

Scheduled Pinned Locked Moved ASP.NET
question
4 Posts 4 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.
  • A Offline
    A Offline
    abglorie
    wrote on last edited by
    #1

    I am declard a field name as date of birty - data type as date now I get a date in a textbox as dd/mm/yyyy format. but sqlserver as mm/dd/yyyy format how can i store into a table as my getting value as dd/mm/yyyy Please give me a source code in vb thanking you abglorie

    C N B 3 Replies Last reply
    0
    • A abglorie

      I am declard a field name as date of birty - data type as date now I get a date in a textbox as dd/mm/yyyy format. but sqlserver as mm/dd/yyyy format how can i store into a table as my getting value as dd/mm/yyyy Please give me a source code in vb thanking you abglorie

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      If you pass the date as a parameter rather than trying to inject it into the SQL String you won't have to worry about date formats. It will also give you an extra benefit of protecting you against SQL Injection Attacks. And this appears to be a database question - Why isn't it in the SQL Forum?


      Upcoming FREE developer events: * Glasgow: SQL Server Managed Objects AND Reporting Services ... My website

      1 Reply Last reply
      0
      • A abglorie

        I am declard a field name as date of birty - data type as date now I get a date in a textbox as dd/mm/yyyy format. but sqlserver as mm/dd/yyyy format how can i store into a table as my getting value as dd/mm/yyyy Please give me a source code in vb thanking you abglorie

        N Offline
        N Offline
        N a v a n e e t h
        wrote on last edited by
        #3

        This is a presentation issue. SQL Server stores date in a particular format. You can change the format when selecting data. Use CONVERT function to format date.

        All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

        1 Reply Last reply
        0
        • A abglorie

          I am declard a field name as date of birty - data type as date now I get a date in a textbox as dd/mm/yyyy format. but sqlserver as mm/dd/yyyy format how can i store into a table as my getting value as dd/mm/yyyy Please give me a source code in vb thanking you abglorie

          B Offline
          B Offline
          ballameharmurali
          wrote on last edited by
          #4

          hello abglorie, in the database change the datatype of the datefieldname as varchar(50) u will get or in the query write it as select convert(varchar(10),getdate(),101) or 103 ok byee murali

          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