Help with debugging application

Hello,

How do you set VS 2010 to display the error message when an error is encountered while running your code? Presently when there is an error the form is displayed with no error messages.

Thanks,

Victor
vcharlesAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Éric MoreauSenior .Net ConsultantCommented:
can we get more details? You surely have a Try ... Catch somewhere that silently get rid of the error.
0
CamilliaCommented:
You need to have a label or literal control...some control on your form to actually display the errors.

For example, if you have this in your aspx page
<asp:Label runat="server" Id="msg" />

When there's an error in your form, you do something like this
msg.Text = "There's an error".

You have to trap the error in your code behind.

This is just one way of doing it. You can do it other ways depending on your code.
0
CamilliaCommented:
Eric, you and I posted at the same time. I've been using this method you have for years...for different projects:

http://www.emoreau.com/Entries/Articles/2008/11/Passing-arguments-to-an-application-startup.aspx
0
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

Éric MoreauSenior .Net ConsultantCommented:
Camillia, how do you know it is a web app?
0
AndyAinscowFreelance programmer / ConsultantCommented:
>>Presently when there is an error the form is displayed with no error messages.

Erm - that sounds like my form is showing correctly but there isn't an error.  Why does my code work?  In other words how do you know there is an error?
0
CamilliaCommented:
Agree Eric. I made an assumption.
0
vcharlesAuthor Commented:
Hi,

I am trying to avoid using on error Goto, used to receive error message but not certain what setting was removed.
Thanks.
0
AndyAinscowFreelance programmer / ConsultantCommented:
>>on error Goto...

Unless I am totally mistaken that isn't part of .net in VB.Net error handling possibilities.
What programming language are you using?
0
vcharlesAuthor Commented:
VB.NET
0
käµfm³d 👽Commented:
@Andy
Unless I am totally mistaken that isn't part of .net in VB.Net error handling possibilities.
I'm afraid you are (though it's not recommended)    ; )

https://msdn.microsoft.com/en-us/library/5hsw66as.aspx
0
AndyAinscowFreelance programmer / ConsultantCommented:
@kaufmed for the info.
Thanks - I'm usually code in C++/C# or VBA.  (Where there is a goto that is to be avoided if at all possible as a rule of thumb)
0
Éric MoreauSenior .Net ConsultantCommented:
Victor, your latest comment doesn't help much. We know it is VB.Net but is it Web, WPF, WinForms, ....?

Do you have Try..Catch that swallow the error?

Do you know the code that you are expecting it to throw an error?
0
vcharlesAuthor Commented:
It is a Windows Form.
I am using on error goto instead of try catch.
The error occurs on conn.open.
Thanks
0
Éric MoreauSenior .Net ConsultantCommented:
the "on error" syntax is the old way. You should really use try ... catch as shown in https://msdn.microsoft.com/en-us/library/fk6t46tz.aspx

Try
   conn.Open....
Catch ex as Exception
   messagebox.show(ex.message)
end try

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
vcharlesAuthor Commented:
Thanks, changed to try catch. Do i need to import  any files or add anything  in reference  section? Trying to compare both apps but can't  find any differences  so far.
0
Éric MoreauSenior .Net ConsultantCommented:
no references needed it is part of the core framework
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.