Click here to Skip to main content
15,914,010 members
Home / Discussions / C#
   

C#

 
QuestionWhen to use new while creating object. Pin
Nitin198121-Dec-06 1:47
Nitin198121-Dec-06 1:47 
AnswerRe: When to use new while creating object. Pin
J4amieC21-Dec-06 2:02
J4amieC21-Dec-06 2:02 
GeneralRe: When to use new while creating object. Pin
Nitin198121-Dec-06 2:13
Nitin198121-Dec-06 2:13 
GeneralRe: When to use new while creating object. Pin
Colin Angus Mackay21-Dec-06 2:26
Colin Angus Mackay21-Dec-06 2:26 
AnswerRe: When to use new while creating object. Pin
Guffa21-Dec-06 2:42
Guffa21-Dec-06 2:42 
GeneralRe: When to use new while creating object. Pin
Pete O'Hanlon21-Dec-06 2:43
mvePete O'Hanlon21-Dec-06 2:43 
GeneralRe: When to use new while creating object. Pin
Russell Jones21-Dec-06 5:47
Russell Jones21-Dec-06 5:47 
AnswerRe: When to use new while creating object. Pin
interface Mirror21-Dec-06 2:40
interface Mirror21-Dec-06 2:40 
Hello,

new is a keyword used to create objects in the memory. Yes, it is only used for declaring reference types.

new allocates memory in the heap for the object and after allocation returns its reference ( memory address ) back to the stack. you can then store that refernce in your object reference.

About DataReader, yes it is correct. new is called inside ExecuteDataReader, so you can not see it.

I hope it helps you.

Kindest Regards,
GeneralRe: When to use new while creating object. Pin
J4amieC21-Dec-06 3:05
J4amieC21-Dec-06 3:05 
GeneralRe: When to use new while creating object. Pin
PIEBALDconsult21-Dec-06 3:40
mvePIEBALDconsult21-Dec-06 3:40 
GeneralRe: When to use new while creating object. Pin
Guffa21-Dec-06 3:42
Guffa21-Dec-06 3:42 
GeneralRe: When to use new while creating object.(For guffa) Pin
Nitin198124-Dec-06 19:36
Nitin198124-Dec-06 19:36 
AnswerRe: When to use new while creating object.(For guffa) Pin
Guffa2-Jan-07 1:58
Guffa2-Jan-07 1:58 
Questionoperator overloading [modified] Pin
swjam21-Dec-06 1:16
swjam21-Dec-06 1:16 
AnswerRe: operator overloading Pin
PIEBALDconsult21-Dec-06 3:48
mvePIEBALDconsult21-Dec-06 3:48 
AnswerRe: operator overloading Pin
Luc Pattyn21-Dec-06 4:30
sitebuilderLuc Pattyn21-Dec-06 4:30 
QuestionHow to call the previously hidden form from the current form Pin
NK721-Dec-06 0:26
NK721-Dec-06 0:26 
AnswerRe: How to call the previously hidden form from the current form Pin
Martin#21-Dec-06 0:55
Martin#21-Dec-06 0:55 
GeneralRe: How to call the previously hidden form from the current form Pin
NK721-Dec-06 2:25
NK721-Dec-06 2:25 
AnswerRe: How to call the previously hidden form from the current form Pin
quiteSmart21-Dec-06 1:18
quiteSmart21-Dec-06 1:18 
GeneralRe: How to call the previously hidden form from the current form Pin
NK721-Dec-06 2:25
NK721-Dec-06 2:25 
AnswerRe: How to call the previously hidden form from the current form Pin
Russell Jones21-Dec-06 5:55
Russell Jones21-Dec-06 5:55 
Questionhow to use commandBuilder ? Pin
hdv21221-Dec-06 0:17
hdv21221-Dec-06 0:17 
AnswerRe: how to use commandBuilder ? Pin
Stefan Troschuetz21-Dec-06 0:36
Stefan Troschuetz21-Dec-06 0:36 
QuestionFolder Access Permission for C# Application Pin
Rsekaran20-Dec-06 23:10
Rsekaran20-Dec-06 23:10 

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.