Click here to Skip to main content
15,889,595 members
Home / Discussions / C#
   

C#

 
GeneralRe: using (SqlTransaction... ) Pin
PIEBALDconsult30-Mar-10 4:27
mvePIEBALDconsult30-Mar-10 4:27 
QuestionHow does CLR differentiates between value and reference types Pin
Praveen Raghuvanshi28-Mar-10 23:00
professionalPraveen Raghuvanshi28-Mar-10 23:00 
AnswerRe: How does CLR differentiates between value and reference types Pin
PSK_28-Mar-10 23:52
PSK_28-Mar-10 23:52 
AnswerRe: How does CLR differentiates between value and reference types Pin
Keith Barrow29-Mar-10 0:06
professionalKeith Barrow29-Mar-10 0:06 
GeneralRe: How does CLR differentiates between value and reference types Pin
Praveen Raghuvanshi29-Mar-10 1:39
professionalPraveen Raghuvanshi29-Mar-10 1:39 
AnswerRe: How does CLR differentiates between value and reference types Pin
Gideon Engelberth29-Mar-10 2:55
Gideon Engelberth29-Mar-10 2:55 
AnswerRe: How does CLR differentiates between value and reference types Pin
PIEBALDconsult29-Mar-10 4:17
mvePIEBALDconsult29-Mar-10 4:17 
AnswerRe: How does CLR differentiates between value and reference types Pin
harold aptroot29-Mar-10 5:07
harold aptroot29-Mar-10 5:07 
Do you want a simple answer or all the gory details[^]?

Simple:
Rags1512 wrote:
how does CLR differentiate between the two

It's in the metadata, see .NET file format - Signatures under the hood, Part 1 of 2[^]
Rags1512 wrote:
stores the value type on Stack and reference types on Heap

That's very misleading, reference types end up putting something in the heap as well as on the stack and value types may well be in the heap (as a field of a reference type, for example). The (well "a") difference is that an instance of a value type can be on the stack, whereas an instance of a reference type is always in the heap (but it may have a reference to it on the stack)
Rags1512 wrote:

Question is where does the employeeCount will get stored(Stack or Heap) and Where does the cmpny gets stored?

employeeCount will be in the heap, inside the instance of the Company it is part of. Where cmpny is stored is impossible to tell without more context. If that line is part of the declaration of a reference type (field with initializer) it will be in the heap as part of it's parent object, if that like is part of the declaration of a value type it may end up on the stack (or the instance of the value type it is in could be a field of a reference type), if that line is inside a method (local variable with initializer) it will definitely be on the stack. But the instance of the Company that cmpny refers to will always be in the heap.

I think.
AnswerRe: How does CLR differentiates between value and reference types Pin
Tej Aj29-Mar-10 5:25
Tej Aj29-Mar-10 5:25 
GeneralRe: How does CLR differentiates between value and reference types Pin
Praveen Raghuvanshi29-Mar-10 19:34
professionalPraveen Raghuvanshi29-Mar-10 19:34 
GeneralRe: How does CLR differentiates between value and reference types Pin
Tej Aj31-Mar-10 1:18
Tej Aj31-Mar-10 1:18 
QuestionPassing Values from a textbox in a form to a SQL Stored Procedure Pin
valkerieforever28-Mar-10 23:00
valkerieforever28-Mar-10 23:00 
AnswerRe: Passing Values from a textbox in a form to a SQL Stored Procedure Pin
R. Giskard Reventlov28-Mar-10 23:43
R. Giskard Reventlov28-Mar-10 23:43 
Questionworking on treeview Pin
thirdy3328-Mar-10 22:24
thirdy3328-Mar-10 22:24 
AnswerRe: working on treeview [modified] Pin
mrcooll28-Mar-10 22:33
mrcooll28-Mar-10 22:33 
AnswerRe: working on treeview Pin
Praveen Raghuvanshi28-Mar-10 22:41
professionalPraveen Raghuvanshi28-Mar-10 22:41 
QuestionWriting C# Code when working with MS Access 2007-2010 Pin
Said Ali Jalali28-Mar-10 21:51
Said Ali Jalali28-Mar-10 21:51 
AnswerRe: Writing C# Code when working with MS Access 2007-2010 Pin
R. Giskard Reventlov28-Mar-10 22:34
R. Giskard Reventlov28-Mar-10 22:34 
AnswerRe: Writing C# Code when working with MS Access 2007-2010 Pin
Dave Kreskowiak29-Mar-10 3:38
mveDave Kreskowiak29-Mar-10 3:38 
QuestionA Question about List<T> in C# [modified] Pin
jojoba201128-Mar-10 19:55
jojoba201128-Mar-10 19:55 
AnswerRe: A Question about List in C# Pin
Gaurav Dudeja India28-Mar-10 19:57
Gaurav Dudeja India28-Mar-10 19:57 
GeneralRe: A Question about List in C# Pin
Brad Barnhill9-Apr-10 2:05
Brad Barnhill9-Apr-10 2:05 
QuestionRe: A Question about List in C# Pin
jojoba201128-Mar-10 20:02
jojoba201128-Mar-10 20:02 
AnswerRe: A Question about List in C# Pin
Mycroft Holmes28-Mar-10 20:31
professionalMycroft Holmes28-Mar-10 20:31 
AnswerMessage Removed Pin
28-Mar-10 20:27
Tej Aj28-Mar-10 20:27 

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.