hello
when I run my application, I have this error message
"la référence d'objet n'est pas définie à une instance d'un objet"
I would like to avoid displaying this error message.
Best regard
hello
when I run my application, I have this error message
"la référence d'objet n'est pas définie à une instance d'un objet"
I would like to avoid displaying this error message.
Best regard
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Mahesh ChandRank #1 · 393.4K reputationPosted May 4, 2009, 11:24 AM EDT
As message says, you first must create an object using "new" keyword. Avoiding error message is not going to help.
Posted May 5, 2009, 4:21 AM EDT
hello;
I know this solution but, I would like hide this message !
have you any solution ?
have a nice week end
Niradhip ChakrabortyRank #429 · 5.8K reputationPosted May 5, 2009, 5:07 AM EDT
Posted May 5, 2009, 5:26 AM EDT
How to do it ?
Niradhip ChakrabortyRank #429 · 5.8K reputationPosted May 5, 2009, 5:46 AM EDT
say you have a form called as "error". In this form You can have some custom message.
Now say you are geting error in sudmit event handler. It will go to catch block and close the form and open the error form which you have created for custom message
private void btnSave_Click(object sender, System.EventArgs e)
{
try
{
//put all your submit event handler code here
}
catch
{
// code to close this form and open the error form here
}
finally
{
}
}