Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Exceptionhandling & errormessage

Reply
Thread Tools

Exceptionhandling & errormessage

 
 
BenCoo
Guest
Posts: n/a
 
      04-28-2007
Hi,

In my ASP.NET application I do some exceptionhandling and redirect the
exception with Session("Exception") to an Errorpage.aspx. When I put the
error in a label I get the following :

System.NotSupportedException: Inserting is not supported by ObjectDataSource
'objDsrLocationEdit' unless the InsertMethod is specified. at
System.Web.UI.WebControls.ObjectDataSourceView.Exe cuteInsert(IDictionary
values) at System.Web.UI.DataSourceView.Insert(IDictionary values,
DataSourceViewOperationCallback callback) at
System.Web.UI.WebControls.DetailsView.HandleInsert (String commandArg,
Boolean causesValidation) at
System.Web.UI.WebControls.DetailsView.HandleEvent( EventArgs e, Boolean
causesValidation, String validationGroup) at
System.Web.UI.WebControls.DetailsView.OnBubbleEven t(Object source, EventArgs
e) at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
at System.Web.UI.WebControls.DetailsViewRow.OnBubbleE vent(Object source,
EventArgs e) at System.Web.UI.Control.RaiseBubbleEvent(Object source,
EventArgs args) at
System.Web.UI.WebControls.ImageButton.OnCommand(Co mmandEventArgs e) at
System.Web.UI.WebControls.ImageButton.RaisePostBac kEvent(String
eventArgument) at
System.Web.UI.WebControls.ImageButton.System.Web.U I.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument) at
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl,
String eventArgument) at
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) at
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,
Boolean includeStagesAfterAsyncPoint)

This is way to much ... I want just this :

System.NotSupportedException: Inserting is not supported by ObjectDataSource
'objDsrLocationEdit' unless the InsertMethod is specified.

Is that possible ?

Thanks for any help on this,

Benny


 
Reply With Quote
 
 
 
 
Teemu Keiski
Guest
Posts: n/a
 
      04-28-2007
Are you setting the Message in the Label, or just taking ToString() on the
Exception object? If you take just Message property, that should be what you
look for.

Label1.Text = exceptionobject.Message


--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net



"BenCoo" <(E-Mail Removed)> wrote in message
news:UCNYh.146323$(E-Mail Removed)-ops.be...
> Hi,
>
> In my ASP.NET application I do some exceptionhandling and redirect the
> exception with Session("Exception") to an Errorpage.aspx. When I put the
> error in a label I get the following :
>
> System.NotSupportedException: Inserting is not supported by
> ObjectDataSource 'objDsrLocationEdit' unless the InsertMethod is
> specified. at
> System.Web.UI.WebControls.ObjectDataSourceView.Exe cuteInsert(IDictionary
> values) at System.Web.UI.DataSourceView.Insert(IDictionary values,
> DataSourceViewOperationCallback callback) at
> System.Web.UI.WebControls.DetailsView.HandleInsert (String commandArg,
> Boolean causesValidation) at
> System.Web.UI.WebControls.DetailsView.HandleEvent( EventArgs e, Boolean
> causesValidation, String validationGroup) at
> System.Web.UI.WebControls.DetailsView.OnBubbleEven t(Object source,
> EventArgs e) at System.Web.UI.Control.RaiseBubbleEvent(Object source,
> EventArgs args) at
> System.Web.UI.WebControls.DetailsViewRow.OnBubbleE vent(Object source,
> EventArgs e) at System.Web.UI.Control.RaiseBubbleEvent(Object source,
> EventArgs args) at
> System.Web.UI.WebControls.ImageButton.OnCommand(Co mmandEventArgs e) at
> System.Web.UI.WebControls.ImageButton.RaisePostBac kEvent(String
> eventArgument) at
> System.Web.UI.WebControls.ImageButton.System.Web.U I.IPostBackEventHandler.RaisePostBackEvent(String
> eventArgument) at
> System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl,
> String eventArgument) at
> System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) at
> System.Web.UI.Page.ProcessRequestMain(Boolean
> includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
>
> This is way to much ... I want just this :
>
> System.NotSupportedException: Inserting is not supported by
> ObjectDataSource 'objDsrLocationEdit' unless the InsertMethod is
> specified.
>
> Is that possible ?
>
> Thanks for any help on this,
>
> Benny
>


 
Reply With Quote
 
 
 
 
Jeeva S
Guest
Posts: n/a
 
      04-29-2007
On Apr 28, 11:53 pm, "BenCoo" <(E-Mail Removed)> wrote:
> Hi,
>
> In my ASP.NET application I do some exceptionhandling and redirect the
> exception with Session("Exception") to an Errorpage.aspx. When I put the
> error in a label I get the following :
>
> System.NotSupportedException: Inserting is not supported by ObjectDataSource
> 'objDsrLocationEdit' unless the InsertMethod is specified. at
> System.Web.UI.WebControls.ObjectDataSourceView.Exe cuteInsert(IDictionary
> values) at System.Web.UI.DataSourceView.Insert(IDictionary values,
> DataSourceViewOperationCallback callback) at
> System.Web.UI.WebControls.DetailsView.HandleInsert (String commandArg,
> Boolean causesValidation) at
> System.Web.UI.WebControls.DetailsView.HandleEvent( EventArgs e, Boolean
> causesValidation, String validationGroup) at
> System.Web.UI.WebControls.DetailsView.OnBubbleEven t(Object source, EventArgs
> e) at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
> at System.Web.UI.WebControls.DetailsViewRow.OnBubbleE vent(Object source,
> EventArgs e) at System.Web.UI.Control.RaiseBubbleEvent(Object source,
> EventArgs args) at
> System.Web.UI.WebControls.ImageButton.OnCommand(Co mmandEventArgs e) at
> System.Web.UI.WebControls.ImageButton.RaisePostBac kEvent(String
> eventArgument) at
> System.Web.UI.WebControls.ImageButton.System.Web.U I.IPostBackEventHandler..R*aisePostBackEvent(Strin g
> eventArgument) at
> System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl,
> String eventArgument) at
> System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) at
> System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,
> Boolean includeStagesAfterAsyncPoint)
>
> This is way to much ... I want just this :
>
> System.NotSupportedException: Inserting is not supported by ObjectDataSource
> 'objDsrLocationEdit' unless the InsertMethod is specified.
>
> Is that possible ?
>
> Thanks for any help on this,
>
> Benny


if u can post ur code, wud be better to find the problem

 
Reply With Quote
 
BenCoo
Guest
Posts: n/a
 
      04-29-2007
Hi,

In the page where I put the exceptionhandling I have the following code:


Protected Sub Page_Error(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Error
Dim ex As Exception
ex = Server.GetLastError
Session("Exception") = ex.ToString
Response.Redirect("ErrorPage.aspx")
End Sub

And in the ErrorPage.aspx

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Me.Load
If Not IsPostBack Then
Me.lblError.Text = Session("Exception")
Session.Remove("Exception")
End If
End Sub

Thanks !

"BenCoo" <(E-Mail Removed)> schreef in bericht
news:UCNYh.146323$(E-Mail Removed)-ops.be...
> Hi,
>
> In my ASP.NET application I do some exceptionhandling and redirect the
> exception with Session("Exception") to an Errorpage.aspx. When I put the
> error in a label I get the following :
>
> System.NotSupportedException: Inserting is not supported by
> ObjectDataSource 'objDsrLocationEdit' unless the InsertMethod is
> specified. at
> System.Web.UI.WebControls.ObjectDataSourceView.Exe cuteInsert(IDictionary
> values) at System.Web.UI.DataSourceView.Insert(IDictionary values,
> DataSourceViewOperationCallback callback) at
> System.Web.UI.WebControls.DetailsView.HandleInsert (String commandArg,
> Boolean causesValidation) at
> System.Web.UI.WebControls.DetailsView.HandleEvent( EventArgs e, Boolean
> causesValidation, String validationGroup) at
> System.Web.UI.WebControls.DetailsView.OnBubbleEven t(Object source,
> EventArgs e) at System.Web.UI.Control.RaiseBubbleEvent(Object source,
> EventArgs args) at
> System.Web.UI.WebControls.DetailsViewRow.OnBubbleE vent(Object source,
> EventArgs e) at System.Web.UI.Control.RaiseBubbleEvent(Object source,
> EventArgs args) at
> System.Web.UI.WebControls.ImageButton.OnCommand(Co mmandEventArgs e) at
> System.Web.UI.WebControls.ImageButton.RaisePostBac kEvent(String
> eventArgument) at
> System.Web.UI.WebControls.ImageButton.System.Web.U I.IPostBackEventHandler.RaisePostBackEvent(String
> eventArgument) at
> System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl,
> String eventArgument) at
> System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) at
> System.Web.UI.Page.ProcessRequestMain(Boolean
> includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
>
> This is way to much ... I want just this :
>
> System.NotSupportedException: Inserting is not supported by
> ObjectDataSource 'objDsrLocationEdit' unless the InsertMethod is
> specified.
>
> Is that possible ?
>
> Thanks for any help on this,
>
> Benny
>



 
Reply With Quote
 
Alvin Bruney [MVP]
Guest
Posts: n/a
 
      04-30-2007
I'm not sure if you solved this problem already but this code does not
indicate the error that you are getting, specifically what are you doing
with 'objDsrLocationEdit' ?

--
Regards,
Alvin Bruney
------------------------------------------------------
Shameless author plug
Excel Services for .NET is coming...
OWC Black book on Amazon and
www.lulu.com/owc
Professional VSTO 2005 - Wrox/Wiley


"BenCoo" <(E-Mail Removed)> wrote in message
news:WF2Zh.147782$(E-Mail Removed)-ops.be...
> Hi,
>
> In the page where I put the exceptionhandling I have the following code:
>
>
> Protected Sub Page_Error(ByVal sender As Object, ByVal e As
> System.EventArgs) Handles Me.Error
> Dim ex As Exception
> ex = Server.GetLastError
> Session("Exception") = ex.ToString
> Response.Redirect("ErrorPage.aspx")
> End Sub
>
> And in the ErrorPage.aspx
>
> Protected Sub Page_Load(ByVal sender As Object, ByVal e As
> System.EventArgs) Handles Me.Load
> If Not IsPostBack Then
> Me.lblError.Text = Session("Exception")
> Session.Remove("Exception")
> End If
> End Sub
>
> Thanks !
>
> "BenCoo" <(E-Mail Removed)> schreef in bericht
> news:UCNYh.146323$(E-Mail Removed)-ops.be...
>> Hi,
>>
>> In my ASP.NET application I do some exceptionhandling and redirect the
>> exception with Session("Exception") to an Errorpage.aspx. When I put the
>> error in a label I get the following :
>>
>> System.NotSupportedException: Inserting is not supported by
>> ObjectDataSource 'objDsrLocationEdit' unless the InsertMethod is
>> specified. at
>> System.Web.UI.WebControls.ObjectDataSourceView.Exe cuteInsert(IDictionary
>> values) at System.Web.UI.DataSourceView.Insert(IDictionary values,
>> DataSourceViewOperationCallback callback) at
>> System.Web.UI.WebControls.DetailsView.HandleInsert (String commandArg,
>> Boolean causesValidation) at
>> System.Web.UI.WebControls.DetailsView.HandleEvent( EventArgs e, Boolean
>> causesValidation, String validationGroup) at
>> System.Web.UI.WebControls.DetailsView.OnBubbleEven t(Object source,
>> EventArgs e) at System.Web.UI.Control.RaiseBubbleEvent(Object source,
>> EventArgs args) at
>> System.Web.UI.WebControls.DetailsViewRow.OnBubbleE vent(Object source,
>> EventArgs e) at System.Web.UI.Control.RaiseBubbleEvent(Object source,
>> EventArgs args) at
>> System.Web.UI.WebControls.ImageButton.OnCommand(Co mmandEventArgs e) at
>> System.Web.UI.WebControls.ImageButton.RaisePostBac kEvent(String
>> eventArgument) at
>> System.Web.UI.WebControls.ImageButton.System.Web.U I.IPostBackEventHandler.RaisePostBackEvent(String
>> eventArgument) at
>> System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
>> sourceControl, String eventArgument) at
>> System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) at
>> System.Web.UI.Page.ProcessRequestMain(Boolean
>> includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
>>
>> This is way to much ... I want just this :
>>
>> System.NotSupportedException: Inserting is not supported by
>> ObjectDataSource 'objDsrLocationEdit' unless the InsertMethod is
>> specified.
>>
>> Is that possible ?
>>
>> Thanks for any help on this,
>>
>> Benny
>>

>
>



 
Reply With Quote
 
BenCoo
Guest
Posts: n/a
 
      04-30-2007
I call the objDsrLocationInsert from within the objDsrLocation object (type
ObjectDataSource) It is normal that I get this error while I don't have
written the Insert methode yet. I get simular error messages for the Update
and Delete method while they are also not written yet.

The only thing is, I just want to have a smaller error message as shown
belllow. Something like this:

System.NotSupportedException: Inserting is not supported by
ObjectDataSource 'objDsrLocationEdit' unless the InsertMethod is pecified.

This is the realy error description I think, the rest is added by the
debuger and I don't want that in my label (is not of importance) in the GUI.

Regards,

Benny

"Alvin Bruney [MVP]" <some guy without an email address> schreef in bericht
news:(E-Mail Removed)...
> I'm not sure if you solved this problem already but this code does not
> indicate the error that you are getting, specifically what are you doing
> with 'objDsrLocationEdit' ?
>
> --
> Regards,
> Alvin Bruney
> ------------------------------------------------------
> Shameless author plug
> Excel Services for .NET is coming...
> OWC Black book on Amazon and
> www.lulu.com/owc
> Professional VSTO 2005 - Wrox/Wiley
>
>
> "BenCoo" <(E-Mail Removed)> wrote in message
> news:WF2Zh.147782$(E-Mail Removed)-ops.be...
>> Hi,
>>
>> In the page where I put the exceptionhandling I have the following code:
>>
>>
>> Protected Sub Page_Error(ByVal sender As Object, ByVal e As
>> System.EventArgs) Handles Me.Error
>> Dim ex As Exception
>> ex = Server.GetLastError
>> Session("Exception") = ex.ToString
>> Response.Redirect("ErrorPage.aspx")
>> End Sub
>>
>> And in the ErrorPage.aspx
>>
>> Protected Sub Page_Load(ByVal sender As Object, ByVal e As
>> System.EventArgs) Handles Me.Load
>> If Not IsPostBack Then
>> Me.lblError.Text = Session("Exception")
>> Session.Remove("Exception")
>> End If
>> End Sub
>>
>> Thanks !
>>
>> "BenCoo" <(E-Mail Removed)> schreef in bericht
>> news:UCNYh.146323$(E-Mail Removed)-ops.be...
>>> Hi,
>>>
>>> In my ASP.NET application I do some exceptionhandling and redirect the
>>> exception with Session("Exception") to an Errorpage.aspx. When I put the
>>> error in a label I get the following :
>>>
>>> System.NotSupportedException: Inserting is not supported by
>>> ObjectDataSource 'objDsrLocationEdit' unless the InsertMethod is
>>> specified. at
>>> System.Web.UI.WebControls.ObjectDataSourceView.Exe cuteInsert(IDictionary
>>> values) at System.Web.UI.DataSourceView.Insert(IDictionary values,
>>> DataSourceViewOperationCallback callback) at
>>> System.Web.UI.WebControls.DetailsView.HandleInsert (String commandArg,
>>> Boolean causesValidation) at
>>> System.Web.UI.WebControls.DetailsView.HandleEvent( EventArgs e, Boolean
>>> causesValidation, String validationGroup) at
>>> System.Web.UI.WebControls.DetailsView.OnBubbleEven t(Object source,
>>> EventArgs e) at System.Web.UI.Control.RaiseBubbleEvent(Object source,
>>> EventArgs args) at
>>> System.Web.UI.WebControls.DetailsViewRow.OnBubbleE vent(Object source,
>>> EventArgs e) at System.Web.UI.Control.RaiseBubbleEvent(Object source,
>>> EventArgs args) at
>>> System.Web.UI.WebControls.ImageButton.OnCommand(Co mmandEventArgs e) at
>>> System.Web.UI.WebControls.ImageButton.RaisePostBac kEvent(String
>>> eventArgument) at
>>> System.Web.UI.WebControls.ImageButton.System.Web.U I.IPostBackEventHandler.RaisePostBackEvent(String
>>> eventArgument) at
>>> System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
>>> sourceControl, String eventArgument) at
>>> System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) at
>>> System.Web.UI.Page.ProcessRequestMain(Boolean
>>> includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
>>>
>>> This is way to much ... I want just this :
>>>
>>> System.NotSupportedException: Inserting is not supported by
>>> ObjectDataSource 'objDsrLocationEdit' unless the InsertMethod is
>>> specified.
>>>
>>> Is that possible ?
>>>
>>> Thanks for any help on this,
>>>
>>> Benny
>>>

>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reset errormessage on CustomValidator =?Utf-8?B?RG9ydGU=?= ASP .Net 1 05-07-2004 01:31 PM
Exceptionhandling in statemachine Joergen Vig Javascript 1 01-24-2004 11:10 AM
The position of the validator errormessage Arjen ASP .Net 2 08-02-2003 11:44 AM
Errormessage in CustomValidator Edmilson ASP .Net 0 07-10-2003 12:56 PM
ErrorMessage Kenny ASP .Net 1 07-06-2003 12:13 AM



Advertisments