ive got this error when y try to insert a row in my oracle database.. im using the delete, insert function that are provided by aspxgridview.
ive heard that it could be a “;” at the end of the sql instructions but there is not “;” in this sql sentences, this is the code with the sql instructions for insert, update, etc…
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConflictDetection="CompareAllValues"
ConnectionString="<%$ ConnectionStrings:ConnectionStringora %>"
DeleteCommand="DELETE FROM "MAQUINA" WHERE "PATENTE" = ? AND "MARCA" = ? AND "MODELO" = ? AND "AÑO" = ? AND "FECHA_ADQUISICION" = ? AND "ESTADO" = ? AND "IDCONDUCTOR" = ? AND "IDMANTENCION" = ?"
InsertCommand="INSERT INTO "MAQUINA" ("PATENTE", "MARCA", "MODELO", "AÑO", "FECHA_ADQUISICION", "ESTADO", "IDCONDUCTOR", "IDMANTENCION") VALUES (?, ?, ?, ?, ?, ?, ?, ?)"
OldValuesParameterFormatString="original_{0}"
ProviderName="<%$ ConnectionStrings:ConnectionStringora.ProviderName %>"
SelectCommand="SELECT "PATENTE", "MARCA", "MODELO", "AÑO", "FECHA_ADQUISICION", "ESTADO", "IDCONDUCTOR", "IDMANTENCION" FROM "MAQUINA""
UpdateCommand="UPDATE "MAQUINA" SET "MARCA" = ?, "MODELO" = ?, "AÑO" = ?, "FECHA_ADQUISICION" = ?, "ESTADO" = ?, "IDCONDUCTOR" = ?, "IDMANTENCION" = ? WHERE "PATENTE" = ? AND "MARCA" = ? AND "MODELO" = ? AND "AÑO" = ? AND "FECHA_ADQUISICION" = ? AND "ESTADO" = ? AND "IDCONDUCTOR" = ? AND "IDMANTENCION" = ?">
the other thing that i think it could cause this problem is the date field (FECHA_ADQUISICION).. aspxgridview uses the format dd-mm-yyy, i dont know if oracle accept that, because when i tried to make an insertion from the “server explorer” (that part where you can watch your databases) i had a problem with the date, i got “ORA-01843 not a valid month” error.. so i could not make an insertion from there.
help please!
"is your problem. Replace it with single quote (') and it will work.*Updated:
Instead of hardcoding your sql queries, pass it from code behind. It will work. *