473,499 Members | 1,591 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Exception of type System.Exception was thrown.

I am using asp.net c#...I am adding a field to cystal report but I get error
Exception of
type System.Exception 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 17944
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.Exception 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.com>
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 ();

ParameterDiscreteValue discreteVal=new ParameterDiscreteValue ();
paramField.ParameterFieldName="Tip";

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

paramField.CurrentValues.Add (discreteVal);

paramFields.Add (paramField);

this.CrystalReportViewer2 .ParameterFieldInfo =paramFields;


CrystalDecisions.Shared.TableLogOnInfo myLogin=new TableLogOnInfo ();
report.Load (Server.MapPath ("Status.rpt"));

foreach(CrystalDecisions.CrystalReports.Engine.Tab le mytable in
report.Database .Tables )

{

myLogin=mytable.LogOnInfo ;

myLogin.ConnectionInfo .Password ="abc";

myLogin.ConnectionInfo .UserID ="sa";

mytable.ApplyLogOnInfo (myLogin);

}

this.CrystalReportViewer2 .ReportSource =report;

}

catch(Exception ex)

{
}

"Jon Skeet [C# MVP]" <sk***@pobox.com>, iletide sunu yazdi
news:MP************************@msnews.microsoft.c om...
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.Exception 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.com>
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.UnhandledException to see whether you
can see the exception that way...

--
Jon Skeet - <sk***@pobox.com>
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.com>, iletide sunu yazdi
news:MP************************@msnews.microsoft.c om...
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.UnhandledException to see whether you
can see the exception that way...

--
Jon Skeet - <sk***@pobox.com>
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.com>
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.Exception), 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*************@TK2MSFTNGP10.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 ();

ParameterDiscreteValue discreteVal=new ParameterDiscreteValue ();
paramField.ParameterFieldName="Tip";

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

paramField.CurrentValues.Add (discreteVal);

paramFields.Add (paramField);

this.CrystalReportViewer2 .ParameterFieldInfo =paramFields;


CrystalDecisions.Shared.TableLogOnInfo myLogin=new TableLogOnInfo ();
report.Load (Server.MapPath ("Status.rpt"));

foreach(CrystalDecisions.CrystalReports.Engine.Tab le mytable in
report.Database .Tables )

{

myLogin=mytable.LogOnInfo ;

myLogin.ConnectionInfo .Password ="abc";

myLogin.ConnectionInfo .UserID ="sa";

mytable.ApplyLogOnInfo (myLogin);

}

this.CrystalReportViewer2 .ReportSource =report;

}

catch(Exception ex)

{
}

"Jon Skeet [C# MVP]" <sk***@pobox.com>, iletide sunu yazdi
news:MP************************@msnews.microsoft.c om...
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.Exception 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.com>
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
2328
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
4155
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...
4
7526
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...
1
4945
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...
19
3187
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...
2
3857
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...
2
45444
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...
6
1879
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,...
132
5452
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...
2
1132
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...
1
6893
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
7386
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
5468
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,...
0
4599
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...
0
3098
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...
0
3090
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1427
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 ...
1
664
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
295
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.