TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Marc
NA
205
54.4k
Setting an instance to null
Oct 16 2014 8:49 AM
I have a decrypter that returns a decrypted value and decrypted catagory. If for some reason my program cannot find the catagory is it best to set the instance of the catagory to null or dispose it? This way I can still provide the decrypted value, but not the decrypted catagory. Below is what I have done thus far.....
GetKey key = GetKey.Instace[category.ToLower()];
bool ctgry = key.DoesCategoryExist(category.ToLower());
if (ctgry == false)
{
//key.dispose();
key
= null;
// which should work best
?
}
I am also trying to log the fact that no category exists within the if statement or upon the diposel of key without throwing an exemption.
Reply
Answers (
2
)
How can I use sessions in windows application?
put the System.Windows.Form.ComboBox in Datagridview C# wind