Hi Luke,
No, your procedure was what i had followed...but when i tried to delete the item, it would generate an exception error...
Type : System.Reflection.TargetInvoca<wbr></wbr>tionException, mscorlib, Version=<a href="http://2.0.0.0/" target="_blank">2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e08<wbr></wbr>9
Message : Exception has been thrown by the target of an invocation.
Source : mscorlib
Help link :
Data : System.Collections.ListDiction<wbr></wbr>aryInternal
TargetSite : System.Object _InvokeMethodFast(System.Object, System.Object[], System.SignatureStruct ByRef, System.Reflection.MethodAttrib<wbr></wbr>utes, System.RuntimeTypeHandle)
Stack Trace : at System.RuntimeMethodHandle.<wbr></wbr>_InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.RuntimeMethodHandle<wbr></wbr>.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMetho<wbr></wbr>dInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMetho<wbr></wbr>dInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Web.UI.WebControls<wbr></wbr>.ObjectDataSourceView.InvokeMe<wbr></wbr>thod(ObjectDataSourceMethod method, Boolean disposeInstance, Object& instance)
at System.Web.UI.WebControls<wbr></wbr>.ObjectDataSourceView.InvokeMe<wbr></wbr>thod(ObjectDataSourceMethod method)
at System.Web.UI.WebControls<wbr></wbr>.ObjectDataSourceView.ExecuteD<wbr></wbr>elete(IDictionary keys, IDictionary oldValues)
at System.Web.UI.DataSourceView<wbr></wbr>.Delete(IDictionary keys, IDictionary oldValues, DataSourceViewOperationCallbac<wbr></wbr>k callback)
at System.Web.UI.WebControls<wbr></wbr>.GridView.HandleDelete(GridViewRow row, Int32 rowIndex)
at System.Web.UI.WebControls<wbr></wbr>.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup)
at System.Web.UI.WebControls<wbr></wbr>.GridView.OnBubbleEvent(Object source, EventArgs e)
at System.Web.UI.Control.RaiseBub<wbr></wbr>bleEvent(Object source, EventArgs args)
at System.Web.UI.WebControls<wbr></wbr>.GridViewRow.OnBubbleEvent(Object source, EventArgs e)
at System.Web.UI.Control.RaiseBub<wbr></wbr>bleEvent(Object source, EventArgs args)
at System.Web.UI.WebControls<wbr></wbr>.Button.OnCommand(CommandEventArgs e)
at System.Web.UI.WebControls<wbr></wbr>.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls<wbr></wbr>.Button.System.Web.UI.IPostBac<wbr></wbr>kEventHandler.RaisePostBackEve<wbr></wbr>nt(String eventArgument)
at System.Web.UI.Page.RaisePostBa<wbr></wbr>ckEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBa<wbr></wbr>ckEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequ<wbr></wbr>estMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Inner Exception
---------------
Type : System.Data.SqlClient.SqlExcep<wbr></wbr>tion, System.Data, Version=<a href="http://2.0.0.0/" target="_blank">2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e08<wbr></wbr>9
Message : The DELETE statement conflicted with the REFERENCE constraint "FK_DSC_Product_Review_DSC<wbr></wbr>_Product". The conflict occurred in database "dotcart", table "dbo.DSC_Product_Review", column 'productId'.
The statement has been terminated.
Source : .Net SqlClient Data Provider
Help link :
Errors : System.Data.SqlClient.SqlError<wbr></wbr>Collection
Class : 16
LineNumber : 33
Number : 547
Procedure : DSC_Product_Delete
Server : localhost
State : 0
ErrorCode : -2146232060
Data : System.Collections.ListDiction<wbr></wbr>aryInternal
TargetSite : Void OnError(System.Data.SqlClient.SqlExcep<wbr></wbr>tion, Boolean)
Stack Trace : at System.Data.SqlClient.SqlConne<wbr></wbr>ction.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInter<wbr></wbr>nalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParse<wbr></wbr>r.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParse<wbr></wbr>r.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlComma<wbr></wbr>nd.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlComma<wbr></wbr>nd.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlComma<wbr></wbr>nd.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
at System.Data.SqlClient.SqlComma<wbr></wbr>nd.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlComma<wbr></wbr>nd.ExecuteNonQuery()
at Microsoft.Practices.Enterprise<wbr></wbr>Library.Data.Database.DoExecut<wbr></wbr>eNonQuery(DbCommand command)
at Microsoft.Practices.Enterprise<wbr></wbr>Library.Data.Database.ExecuteN<wbr></wbr>onQuery(DbCommand command)
at XShan.DotShoppingCart.Common<wbr></wbr>.Object.Product.Delete(Int32 productId) in C:\Inetpub\wwwroot\DotShop1<wbr></wbr>\Common\Object\Product.cs:line 703
Category: General
Priority: 0
EventId: 100
Severity: Error
Title:Enterprise Library Exception Handling
Machine: localweb
Application Domain: /LM/W3SVC/12964/Root-1-1285098<wbr></wbr>36391023412
Process Id: 4036
Process Name: c:\windows\system32\inetsrv<wbr></wbr>\w3wp.exe
Win32 Thread Id: 32296
Thread Name:
Extended Properties: Url - <a href="http://localhost/Admin/Catalog/Products.aspx" target="_blank">http://localhost/Admin<wbr></wbr>/Catalog/Products.aspx
RawUrl - /Admin/Catalog/Products.aspx
UseAgent - Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022)
UrlReferrer - <a href="http://localhost/Admin/Catalog/Products.aspx" target="_blank">http://localhost/Admin<wbr></wbr>/Catalog/Products.aspx
IPAddress - 10.10.10.1
|