Click here to Skip to main content
15,900,364 members
Home / Discussions / C#
   

C#

 
GeneralRe: Types that own disposable fields should be disposable Pin
George_George16-Jun-08 23:16
George_George16-Jun-08 23:16 
QuestionAssign event to a particular combo in a DataGridView Pin
Anoop Unnikrishnan16-Jun-08 19:58
Anoop Unnikrishnan16-Jun-08 19:58 
AnswerRe: Assign event to a particular combo in a DataGridView Pin
N a v a n e e t h16-Jun-08 20:52
N a v a n e e t h16-Jun-08 20:52 
Questionwhy should we assigne an object to null? Pin
fateme_developer16-Jun-08 19:23
fateme_developer16-Jun-08 19:23 
AnswerRe: why should we assigne an object to null? Pin
arslanjatt16-Jun-08 19:35
arslanjatt16-Jun-08 19:35 
GeneralRe: why should we assigne an object to null? Pin
N a v a n e e t h16-Jun-08 20:48
N a v a n e e t h16-Jun-08 20:48 
GeneralRe: why should we assigne an object to null? Pin
MarkB77716-Jun-08 21:03
MarkB77716-Jun-08 21:03 
GeneralRe: why should we assigne an object to null? Pin
N a v a n e e t h16-Jun-08 21:16
N a v a n e e t h16-Jun-08 21:16 
Hello Mark,

MarkBrock wrote:
Do developers consider it good practise to always initialise an instance to null when they are declared?


I am not sure, but I never used to assign NULL when it is declaring.
object obj;
object obj1 = null;
Console.WriteLine(obj == null);
Console.WriteLine(obj1 == null);
This won't compile. Compiler will give error saying obj is not assigned. So easily I can find out uninitialized variables. But if you assign NULL to it and forget to initialize, compiler won't give any error, but you will end with a NullReferenceException at the runtime. I think performance wise there won't be any difference.

All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia

How to use google | Ask smart questions

GeneralRe: why should we assigne an object to null? Pin
Alan Balkany17-Jun-08 4:26
Alan Balkany17-Jun-08 4:26 
GeneralRe: why should we assigne an object to null? Pin
fateme_developer18-Jun-08 21:14
fateme_developer18-Jun-08 21:14 
GeneralRe: why should we assigne an object to null? Pin
Alan Balkany19-Jun-08 3:24
Alan Balkany19-Jun-08 3:24 
GeneralRe: why should we assigne an object to null? Pin
fateme_developer20-Jun-08 22:38
fateme_developer20-Jun-08 22:38 
GeneralRe: why should we assigne an object to null? Pin
fateme_developer22-Jun-08 0:41
fateme_developer22-Jun-08 0:41 
GeneralRe: why should we assigne an object to null? Pin
Alan Balkany23-Jun-08 6:01
Alan Balkany23-Jun-08 6:01 
AnswerRe: why should we assigne an object to null? [modified] Pin
N a v a n e e t h16-Jun-08 20:46
N a v a n e e t h16-Jun-08 20:46 
QuestionPrint doc files without MS Word Pin
arslanjatt16-Jun-08 18:55
arslanjatt16-Jun-08 18:55 
AnswerRe: Print doc files without MS Word Pin
Simon P Stevens16-Jun-08 22:45
Simon P Stevens16-Jun-08 22:45 
QuestionHow to Add References Dynamically ? Pin
hdv21216-Jun-08 17:29
hdv21216-Jun-08 17:29 
AnswerRe: How to Add References Dynamically ? Pin
dan!sh 16-Jun-08 19:49
professional dan!sh 16-Jun-08 19:49 
AnswerRe: How to Add References Dynamically ? Pin
N a v a n e e t h16-Jun-08 20:40
N a v a n e e t h16-Jun-08 20:40 
GeneralRe: How to Add References Dynamically ? Pin
hdv21217-Jun-08 14:05
hdv21217-Jun-08 14:05 
Questionplease solve this webservice problem Pin
Shaik Haneef16-Jun-08 17:09
Shaik Haneef16-Jun-08 17:09 
QuestionSerialPort class with inverted logic Pin
User 1278216-Jun-08 16:07
User 1278216-Jun-08 16:07 
QuestionStructs Pin
Illegal Operation16-Jun-08 15:47
Illegal Operation16-Jun-08 15:47 
AnswerRe: Structs Pin
N a v a n e e t h16-Jun-08 20:38
N a v a n e e t h16-Jun-08 20:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.