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

C#

 
Answerfound the answer :) Pin
leeoze16-Sep-10 3:43
leeoze16-Sep-10 3:43 
QuestionDatagridview returns wrong rownumber Pin
RobScripta16-Sep-10 3:09
professionalRobScripta16-Sep-10 3:09 
AnswerRe: Datagridview returns wrong rownumber Pin
PIEBALDconsult16-Sep-10 3:15
mvePIEBALDconsult16-Sep-10 3:15 
GeneralRe: Datagridview returns wrong rownumber Pin
RobScripta16-Sep-10 3:23
professionalRobScripta16-Sep-10 3:23 
AnswerRe: Datagridview returns wrong rownumber Pin
RobScripta16-Sep-10 4:10
professionalRobScripta16-Sep-10 4:10 
AnswerProblem solved Pin
RobScripta16-Sep-10 4:29
professionalRobScripta16-Sep-10 4:29 
QuestionC# Pin
arindam201016-Sep-10 1:23
arindam201016-Sep-10 1:23 
AnswerRe: C# Pin
OriginalGriff16-Sep-10 1:54
mveOriginalGriff16-Sep-10 1:54 
No. It won't compile - it will complain that you cannot implicitly cast a Class A to Class B (you can explicitly, but that won't execute either.)

Think about it: if you create an instance of A and try to use it as a B what happens? Any additional elements in B do not exist in your instance of A. For example, if B has a public string called "Text" that is not in A, what happens in your code if you say
static void Main(string[] args)
   {
   B obj1 = new A();
   Message.Show(obj1.Text);
   }
Where is the Text to come form - it hasn't been allocated in A!
It's like buying a loaf of bread and trying to treat it as a banana!
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.

GeneralMessage Removed Pin
16-Sep-10 2:08
arindam201016-Sep-10 2:08 
GeneralRe: C# Pin
Not Active16-Sep-10 2:17
mentorNot Active16-Sep-10 2:17 
AnswerInterview question Pin
Not Active16-Sep-10 2:16
mentorNot Active16-Sep-10 2:16 
GeneralRe: Interview question Pin
Luc Pattyn16-Sep-10 2:25
sitebuilderLuc Pattyn16-Sep-10 2:25 
GeneralRe: Interview question Pin
Not Active16-Sep-10 2:59
mentorNot Active16-Sep-10 2:59 
AnswerRe: C# [modified] Pin
OriginalGriff16-Sep-10 5:19
mveOriginalGriff16-Sep-10 5:19 
GeneralRe: C# Pin
Chris Trelawny-Ross16-Sep-10 8:42
Chris Trelawny-Ross16-Sep-10 8:42 
GeneralRe: C# Pin
OriginalGriff16-Sep-10 8:50
mveOriginalGriff16-Sep-10 8:50 
GeneralRe: C# Pin
Pete O'Hanlon16-Sep-10 10:08
mvePete O'Hanlon16-Sep-10 10:08 
GeneralRe: C# Pin
OriginalGriff16-Sep-10 21:23
mveOriginalGriff16-Sep-10 21:23 
AnswerRe: C# Pin
#realJSOP16-Sep-10 23:36
professional#realJSOP16-Sep-10 23:36 
QuestionCreate XML using XSD Pin
NarVish15-Sep-10 23:36
NarVish15-Sep-10 23:36 
AnswerRe: Create XML using XSD Pin
Pete O'Hanlon16-Sep-10 1:31
mvePete O'Hanlon16-Sep-10 1:31 
GeneralRe: Create XML using XSD Pin
NarVish16-Sep-10 1:41
NarVish16-Sep-10 1:41 
GeneralRe: Create XML using XSD Pin
Pete O'Hanlon16-Sep-10 2:05
mvePete O'Hanlon16-Sep-10 2:05 
GeneralRe: Create XML using XSD Pin
NarVish16-Sep-10 2:36
NarVish16-Sep-10 2:36 
AnswerRe: Create XML using XSD Pin
Bernhard Hiller16-Sep-10 2:32
Bernhard Hiller16-Sep-10 2:32 

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.