Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > Oracle ASP
|
Oracle ASP Using ASP with Oracle databases. For Oracle discussions not specific to ASP, please see the Oracle forum. For more ASP discussions, please see the ASP forum category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Oracle ASP 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 November 15th, 2010, 07:44 PM
Registered User
 
Join Date: Nov 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default DataAdapter.Update Oracle Errors

Hi all,

I am having an issue with uploading a dataset to an oracle table. It appears to be associated with the date field that i am attempting to pass in. If i attempt to pass in with a valid formatted DateTime (mm/dd/yyyy) it send an oracle error "Not a Valid Month". If i update this to show as either MON or MONTH format and pass in that value, i receive oracle error "a non-numeric character was found where a numeric was expected".

Please help! I have pasted some of the code below:
--------------------------------------------------
ASP.NET code

Database dbOracle = new Database();
OracleCommand cmdOra = new OracleCommand(StoredProceduresNames.InsertData, dbOracle.OConnection);
cmdOra.CommandType = CommandType.StoredProcedure;
OracleDataAdapter da = new OracleDataAdapter();

//Add the sales date field
cmdOra.Parameters.Add(DetailParameters.SalesDate, OracleDbType.Date, 12, Column.SALES_MM_YY);

da.InsertCommand = cmdOra;
da.Update(dsDataSet, dtDataTable);
---------------------------------------------------
Oracle Sproc code

PROCEDURE INSERT_VALUES
(
v_SALES_DATE IN DATE
)
IS
BEGIN

INSERT INTO TABLE
(
SALE_DT
)
VALUES
(
v_SALES_DATE
);
END;

Last edited by tcraig04; November 15th, 2010 at 07:46 PM..
 
Old November 16th, 2010, 03:17 PM
Registered User
 
Join Date: Nov 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I was able to fix this issue by converting my DateTime to a dd MMM yyyy string format and passing that value in. Oracle can then convert this string into the correct DateTime in the database.





Similar Threads
Thread Thread Starter Forum Replies Last Post
update dataadapter karenai Visual Basic 2005 Basics 0 February 9th, 2008 10:46 PM
DataAdapter.Update puzzle wirerider ASP.NET 2.0 Basics 1 August 1st, 2006 06:57 PM
Datagrid.update() and DataAdapter.Update aarunlal ASP.NET 2.0 Professional 2 February 23rd, 2006 11:41 PM
DataAdapter.Update acts strangely oricalchis ADO.NET 0 September 21st, 2005 06:21 AM





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