Click here to Skip to main content
15,905,781 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi my friends

i has created many c# application until Now , that for prevent some bugs used showdialog() to show forms .

but in last two application i get strange problem when i want show some form with showDialog method,

whereas show method is ok .

i get error like "Object refrence not set ..." on line that ShowDialog Method Defined .

why is Occured And How i can Fix it ?

Thanks guys

best
Posted
Comments
Manu Prasad 11-Oct-14 2:40am    
Can you attach the area of your code thrown the Exception...
Neetin_1809 11-Oct-14 15:34pm    
Hello ,
I Think that you have a form twice may be. Or there can be some type of arguments needs to be passed but not able to pass . Try to identify the flow in which the error is being generated & debug it. Surround your Code With Try Catch block as much as possible

1 solution

Debug your application and see where you are using a null object reference.
 
Share this answer
 
Comments
[no name] 11-Oct-14 3:13am    
unfortunately this error is random , sometime is not appear , and sometime is occur
Mehdi Gholam 11-Oct-14 3:21am    
Then add logging to your application and log the stack trace for the exception which will give you a good place to start debugging from.

You can use log4net or my article below :

http://www.codeproject.com/Articles/136118/Mini-Drop-in-Replacement-for-log-net

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900