Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
|
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 7th, 2005, 10:07 AM
Authorized User
 
Join Date: Oct 2004
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Default Dtabase function in command parameter object?

Hi Everyone,

Does any one know how to call a database function in command parameter object?

Example:

// conn is a valid OracleConnection object
string sql = "Insert into TableA ( modifyDate) values(:p1)"
OracleCommand cmd = new OracleCommand( sql,conn);
cmd.Parameters.AddWithValue("p1", "sysDate")
cmd.ExecuteNonQuery();

I really want to insert the sysdate into that row rather than the string "sysdate".

I know I can modify my sql like the line below but I really want it to work with parameter object.
string sql = "Insert into TableA ( modifyDate) values( sysdate) ";


Thannks,

JDang






Similar Threads
Thread Thread Starter Forum Replies Last Post
Parameter object malfunction - out parameter dash dev C# 2005 6 December 4th, 2007 12:58 PM
Command text was not set for the command object Sheraz Khan Classic ASP Databases 2 May 29th, 2007 12:57 AM
command parameter misterraj ASP.NET 1.0 and 1.1 Professional 0 November 30th, 2005 09:44 AM
Command text was not set for the command object. deepa12 BOOK: Beginning ASP 3.0 5 November 2nd, 2004 05:37 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.