473,412 Members | 2,050 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

Exceptionhandling & errormessage

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
Apr 28 '07 #1
5 1478
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" <te******@hotmail.comwrote in message
news:UC*********************@phobos.telenet-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
Apr 28 '07 #2
On Apr 28, 11:53 pm, "BenCoo" <teddy...@hotmail.comwrote:
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

Apr 29 '07 #3
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" <te******@hotmail.comschreef in bericht
news:UC*********************@phobos.telenet-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

Apr 29 '07 #4
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" <te******@hotmail.comwrote in message
news:WF*********************@phobos.telenet-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" <te******@hotmail.comschreef in bericht
news:UC*********************@phobos.telenet-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.Ex ecuteInsert(IDictionary
values) at System.Web.UI.DataSourceView.Insert(IDictionary values,
DataSourceViewOperationCallback callback) at
System.Web.UI.WebControls.DetailsView.HandleInser t(String commandArg,
Boolean causesValidation) at
System.Web.UI.WebControls.DetailsView.HandleEvent (EventArgs e, Boolean
causesValidation, String validationGroup) at
System.Web.UI.WebControls.DetailsView.OnBubbleEve nt(Object source,
EventArgs e) at System.Web.UI.Control.RaiseBubbleEvent(Object source,
EventArgs args) at
System.Web.UI.WebControls.DetailsViewRow.OnBubble Event(Object source,
EventArgs e) at System.Web.UI.Control.RaiseBubbleEvent(Object source,
EventArgs args) at
System.Web.UI.WebControls.ImageButton.OnCommand(C ommandEventArgs e) at
System.Web.UI.WebControls.ImageButton.RaisePostBa ckEvent(String
eventArgument) at
System.Web.UI.WebControls.ImageButton.System.Web. UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument) at
System.Web.UI.Page.RaisePostBackEvent(IPostBackEv entHandler
sourceControl, String eventArgument) at
System.Web.UI.Page.RaisePostBackEvent(NameValueCo llection 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


Apr 30 '07 #5
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 addressschreef in bericht
news:eB*************@TK2MSFTNGP03.phx.gbl...
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" <te******@hotmail.comwrote in message
news:WF*********************@phobos.telenet-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" <te******@hotmail.comschreef in bericht
news:UC*********************@phobos.telenet-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.E xecuteInsert(IDictionary
values) at System.Web.UI.DataSourceView.Insert(IDictionary values,
DataSourceViewOperationCallback callback) at
System.Web.UI.WebControls.DetailsView.HandleInse rt(String commandArg,
Boolean causesValidation) at
System.Web.UI.WebControls.DetailsView.HandleEven t(EventArgs e, Boolean
causesValidation, String validationGroup) at
System.Web.UI.WebControls.DetailsView.OnBubbleEv ent(Object source,
EventArgs e) at System.Web.UI.Control.RaiseBubbleEvent(Object source,
EventArgs args) at
System.Web.UI.WebControls.DetailsViewRow.OnBubbl eEvent(Object source,
EventArgs e) at System.Web.UI.Control.RaiseBubbleEvent(Object source,
EventArgs args) at
System.Web.UI.WebControls.ImageButton.OnCommand( CommandEventArgs e) at
System.Web.UI.WebControls.ImageButton.RaisePostB ackEvent(String
eventArgument) at
System.Web.UI.WebControls.ImageButton.System.Web .UI.IPostBackEventHandler.RaisePostBackEvent(Strin g
eventArgument) at
System.Web.UI.Page.RaisePostBackEvent(IPostBackE ventHandler
sourceControl, String eventArgument) at
System.Web.UI.Page.RaisePostBackEvent(NameValueC ollection 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



Apr 30 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Harald Mossige | last post by:
Dev-Cpp "dont se" MinGW. (Win2K) I have downloaded and run: devlup4991nomingw_setup.exe and MinGW-3.1.0-1.exe in those dirrectory:
4
by: muz dogru | last post by:
I have made own Exception classes, which extend from Exception. When I throw a new MyException("my error message"), then catch the error and print the message, it's all fine within an application....
5
by: TS | last post by:
From my presentation layer, I call a validation method in my business layer that i pass a custom class to that holds all parameters. I am currently also passing an error message by reference so...
1
by: Kenny | last post by:
Hi, Is it possible to call a function from a control, for e.g <asp:requiredfieldvalidator id="test" errormessage="ccc" /> Is it possible for me to create a FormatErrorMessage function if I want...
4
by: James | last post by:
Hello, I have a RequiredFieldValidator for several textbox controls on a form. Here's an example with the RequiredFieldValidator. EnableClientScript, Enabled, and Visible are set to true for...
2
by: HockeyFan | last post by:
Does anyone have a good genereal exceptionhandling class that can be preferably used with web apps as well as windows apps, but in the least, to be able to work well in web apps. I'm fairly new to...
2
by: PeterKellner | last post by:
I'm wanting to just show the error in a ValidationSummary control, not next to the actual TextField I'm putting a RequiredFieldValidator next to. I don't even want the little "*" showing which...
1
by: Jeff | last post by:
hey asp.net 2.0 I'm trying to create a web page where users can register to my web portal. But I've run into a layout problem when using the data validator classes. The problem is that the...
39
by: dancer | last post by:
Can somebody tell me why I get this message with the following code? Compiler Error Message: BC30452: Operator '&' is not defined for types 'String' and 'System.Web.UI.WebControls.TextBox'. ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.