Insert date into oracle
-
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
-
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
Whats the error message you are getting?
Regards, Venkatesh Mookkan. Software Engineer, India My: Website | Yahoo Group | Blog Spot
-
Whats the error message you are getting?
Regards, Venkatesh Mookkan. Software Engineer, India My: Website | Yahoo Group | Blog Spot