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
  1. Home
  2. Web Development
  3. ASP.NET
  4. Insert date into oracle

Insert date into oracle

Scheduled Pinned Locked Moved ASP.NET
databasecsharporaclehelpannouncement
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.
  • K Offline
    K Offline
    kjosh
    wrote on last edited by
    #1

    Hi, I tried to upfate the date field of table from .net. I have tried like the below: Database db = DatabaseFactory.CreateDatabase(); using (DbConnection connection = db.CreateConnection()) { connection.Open(); DbTransaction transaction = connection.BeginTransaction(IsolationLevel.Serializable); //DateTime dt = Convert.To(TextBox1.Text); string s = "Update table1 set update_dttm = To_Date('" + DateTime.Now.ToShortDateString() + "','dd/mm/yyyy')"; DbCommand pcmd = db.GetSqlStringCommand(s); db.ExecuteNonQuery(pcmd, transaction); transaction.Commit(); } When I execute the string in s in Oracle it is working fine. But from .net I am not getting any error. It is executing continuously. Whats wrong in my code. Thanks in advance

    V 1 Reply Last reply
    0
    • K kjosh

      Hi, I tried to upfate the date field of table from .net. I have tried like the below: Database db = DatabaseFactory.CreateDatabase(); using (DbConnection connection = db.CreateConnection()) { connection.Open(); DbTransaction transaction = connection.BeginTransaction(IsolationLevel.Serializable); //DateTime dt = Convert.To(TextBox1.Text); string s = "Update table1 set update_dttm = To_Date('" + DateTime.Now.ToShortDateString() + "','dd/mm/yyyy')"; DbCommand pcmd = db.GetSqlStringCommand(s); db.ExecuteNonQuery(pcmd, transaction); transaction.Commit(); } When I execute the string in s in Oracle it is working fine. But from .net I am not getting any error. It is executing continuously. Whats wrong in my code. Thanks in advance

      V Offline
      V Offline
      Venkatesh Mookkan
      wrote on last edited by
      #2

      Whats the error message you are getting?

      Regards, Venkatesh Mookkan. Software Engineer, India My: Website | Yahoo Group | Blog Spot

      K 1 Reply Last reply
      0
      • V Venkatesh Mookkan

        Whats the error message you are getting?

        Regards, Venkatesh Mookkan. Software Engineer, India My: Website | Yahoo Group | Blog Spot

        K Offline
        K Offline
        kjosh
        wrote on last edited by
        #3

        Hi, I am not getting any error. The ExecuteNonQuery method is executing continuously. Thanks

        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