Is it possible when throwing a custom exception to pause the program instead of just exiting?
I have a throw customexception("error msg") in my main and I want to print the error msg and then press return to exit or something like that.
@obscured47 You can do anything once you catch the exception.
Why do you want to throw an exception to pause the execution? There could be better ways to do that.
Can you post small segemt of your code and let us know the behaviour you are expecting ?
You need to catch the exception. You need to write a catch block. If you let OS to handle your first chance exception it is going to simply terminate the process because OS does not know which way you want to terminate.
You can try writing the catch block and exit from there.
>I want to throw the exception, the user will see the msg, press return and then terminate.
Set your own custom termination handler. Look in your reference for the <exception> header to get more details.
Dim Adapter As New OleDbDataAdapter
Dim Command As New OleDbCommand
Dim xFrom As String = dtpFrom.Value.ToString.Substring(0, dtpFrom.Value.ToString.IndexOf(" "))
Dim xTo As String = dtpTo.Value.ToString.Substring(0, dtpTo.Value.ToString.IndexOf(" "))
sqlQuery = MainQuery ...