asp.net 2.0 with Oracle delete command

G

george

Hi all -

I am trying to use ASP.NET 2.0 to delete a row in an Oracle database
table GC_LOG
(see following, note that my connection string is fine, everything else
like updateCommand is working)
The ID and ACTION are varchar2(10) and varchar2(200) respectively:

-------------------------
<asp:SqlDataSource ID="SqlDataSource5" runat="server"
ConnectionString="<%$%ConnectionStrings:ConnectionString1 %>"
ProviderName="<%$
ConnectionStrings:ConnectionString1.ProviderName %>"

DeleteCommand=' DELETE GC_LOG
WHERE ID=:ID and ACTION=:ACTION ' >

<DeleteParameters>
<asp:parameter Name="ID" />
<asp:parameter Name="ACTION" />
</DeleteParameters>
</asp:SqlDataSource>
----------------------------

However, I got following error:
System.Data.OracleClient.OracleException: ORA-01008: not all
variables bound

Stack Trace:

[OracleException (0x80131938): ORA-01008: not all variables bound
]
System.Data.OracleClient.OracleConnection.CheckError(OciErrorHandle
errorHandle, Int32 rc) +167
System.Data.OracleClient.OracleCommand.Execute(OciStatementHandle
statementHandle, CommandBehavior behavior, Boolean needRowid,
OciRowidDescriptor& rowidDescriptor, ArrayList&
resultParameterOrdinals) +1719

System.Data.OracleClient.OracleCommand.ExecuteNonQueryInternal(Boolean
needRowid, OciRowidDescriptor& rowidDescriptor) +503
System.Data.OracleClient.OracleCommand.ExecuteNonQuery() +125

System.Web.UI.WebControls.SqlDataSourceView.ExecuteDbCommand(DbCommand
command, DataSourceOperation operation) +493

System.Web.UI.WebControls.SqlDataSourceView.ExecuteDelete(IDictionary
keys, IDictionary oldValues) +913
System.Web.UI.DataSourceView.Delete(IDictionary keys, IDictionary
oldValues, DataSourceViewOperationCallback callback) +176
System.Web.UI.WebControls.GridView.HandleDelete(GridViewRow row,
Int32 rowIndex) +912
System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean
causesValidation, String validationGroup) +1067
System.Web.UI.WebControls.GridView.RaisePostBackEvent(String
eventArgument) +214

System.Web.UI.WebControls.GridView.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument) +31
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +32
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
+244
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+3840

---------------

I then changed the deleteparameters part to
<DeleteParameters>
<asp:parameter Name="@ID" />
<asp:parameter Name="@ACTION" />
</DeleteParameters>

it said "illegal variable name/number"

then, <DeleteParameters>
<asp:parameter Name=":ID" />
<asp:parameter Name=":ACTION" />
</DeleteParameters>

there is no error, but the deleting wasn't carried out -- the data is
still there (although I tested the delete statement manually , it is
working from sqlPlus commnd line).
I also tried to add Type="String" and Type="Empty" in parameter
section, no luck either...

do I miss anything? please help and advise... thanks!
george
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top