473,698 Members | 1,877 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Exception of type System.Exceptio n was thrown.

I am using asp.net c#...I am adding a field to cystal report but I get error
Exception of
type System.Exceptio n was thrown. How can I solve this error...When I insert
a field from another table I dont get error...

Thanks...
Nov 16 '05 #1
6 17962
Selen <sk*****@yahoo. com> wrote:
I am using asp.net c#...I am adding a field to cystal report but I get error
Exception of
type System.Exceptio n was thrown. How can I solve this error...When I insert
a field from another table I dont get error...


Whenever you get an exception, you should look at the message inside it
- it will almost always tell you what went wrong.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #2
How can I look inside it...I am using try catch like that: but I didnt catch
anything...

try

{

ParameterFields paramFields=new ParameterFields ();

ParameterField paramField=new ParameterField ();

ParameterDiscre teValue discreteVal=new ParameterDiscre teValue ();
paramField.Para meterFieldName= "Tip";

discreteVal.Val ue =Session["Tip"].ToString ();

paramField.Curr entValues.Add (discreteVal);

paramFields.Add (paramField);

this.CrystalRep ortViewer2 .ParameterField Info =paramFields;


CrystalDecision s.Shared.TableL ogOnInfo myLogin=new TableLogOnInfo ();
report.Load (Server.MapPath ("Status.rpt")) ;

foreach(Crystal Decisions.Cryst alReports.Engin e.Table mytable in
report.Database .Tables )

{

myLogin=mytable .LogOnInfo ;

myLogin.Connect ionInfo .Password ="abc";

myLogin.Connect ionInfo .UserID ="sa";

mytable.ApplyLo gOnInfo (myLogin);

}

this.CrystalRep ortViewer2 .ReportSource =report;

}

catch(Exception ex)

{
}

"Jon Skeet [C# MVP]" <sk***@pobox.co m>, iletide sunu yazdi
news:MP******** *************** *@msnews.micros oft.com...
Selen <sk*****@yahoo. com> wrote:
I am using asp.net c#...I am adding a field to cystal report but I get error Exception of
type System.Exceptio n was thrown. How can I solve this error...When I insert a field from another table I dont get error...


Whenever you get an exception, you should look at the message inside it
- it will almost always tell you what went wrong.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Nov 16 '05 #3
Selen <sk*****@yahoo. com> wrote:
How can I look inside it...I am using try catch like that: but I didnt catch
anything...


Ah... if you're unable to catch the exception, that certainly makes
things harder.

You could try using the AppDomain.Unhan dledException to see whether you
can see the exception that way...

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #4
I dont know using it...
How can I use it??

Thanks...
"Jon Skeet [C# MVP]" <sk***@pobox.co m>, iletide sunu yazdi
news:MP******** *************** *@msnews.micros oft.com...
Selen <sk*****@yahoo. com> wrote:
How can I look inside it...I am using try catch like that: but I didnt catch anything...


Ah... if you're unable to catch the exception, that certainly makes
things harder.

You could try using the AppDomain.Unhan dledException to see whether you
can see the exception that way...

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Nov 16 '05 #5
Selen <sk*****@yahoo. com> wrote:
I dont know using it...
How can I use it??


The same way you use any event - you subscribe to it, providing a
delegate which will be called when the event fires (in other words,
when an exception is thrown).

You probably then want to log the details of the exception.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #6
Given that your catch handler is catching all managed exceptions
(System.Excepti on), then either you did catch it but didn't do anything with
it, or the exception is thrown from some other part of your code.

Try adding a trace statement inside the catch block and see what it prints
out.

"Selen" <sk*****@yahoo. com> wrote in message
news:Or******** *****@TK2MSFTNG P10.phx.gbl...
How can I look inside it...I am using try catch like that: but I didnt catch anything...

try

{

ParameterFields paramFields=new ParameterFields ();

ParameterField paramField=new ParameterField ();

ParameterDiscre teValue discreteVal=new ParameterDiscre teValue ();
paramField.Para meterFieldName= "Tip";

discreteVal.Val ue =Session["Tip"].ToString ();

paramField.Curr entValues.Add (discreteVal);

paramFields.Add (paramField);

this.CrystalRep ortViewer2 .ParameterField Info =paramFields;


CrystalDecision s.Shared.TableL ogOnInfo myLogin=new TableLogOnInfo ();
report.Load (Server.MapPath ("Status.rpt")) ;

foreach(Crystal Decisions.Cryst alReports.Engin e.Table mytable in
report.Database .Tables )

{

myLogin=mytable .LogOnInfo ;

myLogin.Connect ionInfo .Password ="abc";

myLogin.Connect ionInfo .UserID ="sa";

mytable.ApplyLo gOnInfo (myLogin);

}

this.CrystalRep ortViewer2 .ReportSource =report;

}

catch(Exception ex)

{
}

"Jon Skeet [C# MVP]" <sk***@pobox.co m>, iletide sunu yazdi
news:MP******** *************** *@msnews.micros oft.com...
Selen <sk*****@yahoo. com> wrote:
I am using asp.net c#...I am adding a field to cystal report but I get error Exception of
type System.Exceptio n was thrown. How can I solve this error...When I insert a field from another table I dont get error...


Whenever you get an exception, you should look at the message inside it
- it will almost always tell you what went wrong.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too


Nov 16 '05 #7

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

Similar topics

42
2377
by: cody | last post by:
public DateTime Value { get { try { return new DateTime(int.Parse(tbYear.Text), int.Parse(tbMonth.Text), int.Parse(tbDay.Text)); } catch (FormatException)
44
4212
by: craig | last post by:
I am wondering if there are some best practices for determining a strategy for using try/catch blocks within an application. My current thoughts are: 1. The code the initiates any high-level user tasks should always be included in a try/catch block that actually handles any exceptions that occur (log the exception, display a message box, etc.). 2. Low-level operations that are used to carry out the high level tasks
4
7541
by: Aren Cambre | last post by:
Why does SmtpMail.Send throw an exception if the MailMessage's BodyFormat = MailFormat.Html? I've searched all over the place and cannot find a solution anywhere. I am running this on Windows XP SP2, and IIS's SMTP and WWW servers are installed. Here is the error trace: System.Web.HttpException: Could not access 'CDO.Message' object. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an...
1
4980
by: SMG - Idealake | last post by:
Hi all, I am getting following error on my error, what could be the reason? Exception of type System.OutOfMemoryException was thrown. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.OutOfMemoryException: Exception of type System.OutOfMemoryException was thrown.
19
3210
by: Diego F. | last post by:
I think I'll never come across that error. It happens when running code from a DLL that tries to write to disk. I added permissions in the project folder, the wwwroot and in IIS to NETWORK_SERVICE and Everyone, with Full Control to see if it's a permissions problem. The project is hosted in a Windows 2003 Server and developed from PCs in a domain, developing with Visual Studio 2005 Beta 1. -- Regards,
2
3872
by: Seth | last post by:
Ok, here is my setup. I have a fully functioning HTTP Handler implemented. The handler is supposed to handle every single request that comes in to a particular virtual directory. Thus, in IIS, I have a mapping of .* to the aspnet_isapi.dll. And my web.config has an entry thusly: <add verb="*" path="*" type="HandlerClass, HandlerAssembly" /> And this is working just fine thus far. The handler gets all the requests and works like a...
2
45455
by: Eugene | last post by:
Hi, I have a problem when loading one of my dll. I have a main class that would load a winform in another dll using reflection. When I load it using Assembly.CreateInstance(DLLName.DLLFormName), an exception is thrown with the message: "Exception has been thrown by the target of an invocation." ?ex.Source "mscorlib" ?ex.GetType.AssemblyQualifiedName "System.Reflection.TargetInvocationException, mscorlib, Version=1.0.5000.0,
6
1896
by: semedao | last post by:
Hi All, I had working code that made custom serialization on objects that inherit from queue in the inherited queue I create my own GetObjectData: public void GetObjectData(SerializationInfo info, StreamingContext ctxt) { lock (this.SyncRoot) {
132
5553
by: Zorro | last post by:
The simplicity of stack unraveling of C++ is not without defective consequences. The following article points to C++ examples showing the defects. An engineer aware of defects can avoid hard-to-find bugs. http://distributed-software.blogspot.com/2007/01/c-exception-handling-is-defective.html Regards, zorabi@ZHMicro.com http://www.zhmicro.com http://distributed-software.blogspot.com
2
1144
by: plily | last post by:
Hi, i have created a simple web user control and when i try to run it i get the following error,pls. help: Exception of type System.StackOverflowException was thrown. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.StackOverflowException: Exception of type...
0
8672
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9155
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9018
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7711
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5859
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4360
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4614
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3038
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2322
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.