Click here to Skip to main content
15,891,908 members
Home / Discussions / C#
   

C#

 
GeneralRe: How can I make a method abstract in a child class? Pin
Meysam Mahfouzi4-May-09 2:22
Meysam Mahfouzi4-May-09 2:22 
GeneralRe: How can I make a method abstract in a child class? Pin
Alan N4-May-09 3:26
Alan N4-May-09 3:26 
GeneralRe: How can I make a method abstract in a child class? Pin
Meysam Mahfouzi4-May-09 4:05
Meysam Mahfouzi4-May-09 4:05 
GeneralRe: How can I make a method abstract in a child class? Pin
Alan N4-May-09 4:41
Alan N4-May-09 4:41 
QuestionUrgent Help With Serialization needed Pin
GrgBalden3-May-09 11:46
GrgBalden3-May-09 11:46 
AnswerRe: Urgent Help With Serialization needed Pin
Henry Minute3-May-09 12:39
Henry Minute3-May-09 12:39 
QuestionRe: Urgent Help With Serialization needed Pin
GrgBalden3-May-09 23:10
GrgBalden3-May-09 23:10 
AnswerRe: Urgent Help With Serialization needed Pin
Henry Minute4-May-09 1:33
Henry Minute4-May-09 1:33 
Yes but you will need to instantiate it and give its properties some values.

Add the declaration as you have suggested (I would put it with the other two field declarations). Also, strictly speaking you should make it private, then add a public property for access from outside the class.

Then modify your constructor for NewOrder, something like:
//constructor
public NewOrder()
{
    MyCardDetail = new CardDetail();
    MyCardDetail.CardFirstName = "Horace";
    MyCardDetail.CardLastName = "Horsecollar";
    MyCardDetail.CardNumber = "1ABC23";
}


Henry Minute

Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”

GeneralRe: Urgent Help With Serialization needed Pin
GrgBalden4-May-09 3:09
GrgBalden4-May-09 3:09 
GeneralRe: Urgent Help With Serialization needed Pin
Henry Minute4-May-09 4:10
Henry Minute4-May-09 4:10 
QuestionNeed some help fast:D [modified] Pin
DrJele3-May-09 7:32
DrJele3-May-09 7:32 
AnswerRe: Need some help fast:D Pin
Henry Minute3-May-09 8:46
Henry Minute3-May-09 8:46 
GeneralRe: Need some help fast:D Pin
Member 10339073-May-09 10:43
Member 10339073-May-09 10:43 
GeneralRe: Need some help fast:D Pin
DrJele4-May-09 10:29
DrJele4-May-09 10:29 
GeneralRe: Need some help fast:D Pin
Member 10339074-May-09 20:55
Member 10339074-May-09 20:55 
Questionerror using float for array to string Pin
onetreeup3-May-09 7:26
onetreeup3-May-09 7:26 
AnswerRe: error using float for array to string Pin
fly9043-May-09 8:06
fly9043-May-09 8:06 
QuestionAcess control system for company entrance Pin
7alool3-May-09 4:41
7alool3-May-09 4:41 
AnswerRe: Acess control system for company entrance Pin
PIEBALDconsult3-May-09 5:43
mvePIEBALDconsult3-May-09 5:43 
AnswerRe: Acess control system for company entrance Pin
Dave Kreskowiak3-May-09 6:39
mveDave Kreskowiak3-May-09 6:39 
QuestionPrinter on distributed system Pin
Snappy Wing3-May-09 4:39
Snappy Wing3-May-09 4:39 
AnswerRe: Printer on distributed system Pin
Dave Kreskowiak3-May-09 6:40
mveDave Kreskowiak3-May-09 6:40 
Question2d drawing (visualstudio2005) [modified] Pin
lor3n7o3-May-09 2:11
lor3n7o3-May-09 2:11 
AnswerRe: 2d drawing (visualstudio2005) Pin
Henry Minute3-May-09 2:21
Henry Minute3-May-09 2:21 
GeneralRe: 2d drawing (visualstudio2005) Pin
lor3n7o3-May-09 3:44
lor3n7o3-May-09 3:44 

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.