c# - Format a date so it can be written into Oracle ("Not a valid month" error) -


having trouble finding proper syntax this. here's field on asp side:

<input type="text" id="ei_open_auditstartdt" class="datepicker" runat="server"      name="ei_open_auditstartdt" value='<%#eval("audit_start_date") %>'      style="width: 100px" /> 

here's part of code-behind in c#:

htmlinputtext ei_open_auditstartdt = (htmlinputtext)datagrid_open.rows[e.rowindex].findcontrol("ei_open_auditstartdt"); textbox ei_open_transcit = (textbox)datagrid_open.rows[e.rowindex].findcontrol("ei_open_transcit");  string startdt = string.format("{0:dd-mmm-yyyy}", ei_open_auditstartdt.value); string transcit = ei_open_transcit.text;  datagrid_rootcauses.editindex = -1;  oracleconnection conn = getconnection(); try {     using (oraclecommand cmd = new oraclecommand("cst_amr_write_openstatus", conn))     {         cmd.commandtype = commandtype.storedprocedure;          using (oracledataadapter da = new oracledataadapter(cmd))         {             cmd.parameters.addwithvalue("v_startdt", oracletype.datetime).value = startdt;             cmd.parameters.addwithvalue("v_transcit", oracletype.varchar).value = transcit; 

the problem is, when gets string startdt, still sees value as, say, "03/24/2017" instead of "24-mar-17", i'm getting "not valid month" error.

can see i'm doing wrong?

  1. verify format of data stored in oracle db.

  2. attempt insert data raw string, in format , see if succeeds.

that takes calling code out of possible variables affecting problem.

  1. if still doesn't work, have @ stored procedure , figure out if it's converting formats without knowledge.

  2. if don't have ability see stored procedure, going have try bunch of different formats in calling code until find right one.


Comments

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -