Home All Groups Group Topic Archive Search About
Author
24 Oct 2006 10:51 PM
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!

AddThis Social Bookmark Button