Click here to Skip to main content
15,887,283 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to show A Form in openfiledialog? Pin
Mycroft Holmes28-Feb-10 23:59
professionalMycroft Holmes28-Feb-10 23:59 
GeneralRe: How to show A Form in openfiledialog? Pin
OriginalGriff1-Mar-10 0:26
mveOriginalGriff1-Mar-10 0:26 
GeneralRe: How to show A Form in openfiledialog? Pin
Pawan Kiran1-Mar-10 3:58
Pawan Kiran1-Mar-10 3:58 
AnswerRe: How to show A Form in openfiledialog? Pin
OriginalGriff1-Mar-10 0:28
mveOriginalGriff1-Mar-10 0:28 
QuestionLocalisation Pin
gwithey28-Feb-10 21:17
gwithey28-Feb-10 21:17 
QuestionMessage Removed Pin
28-Feb-10 20:28
user20528-Feb-10 20:28 
AnswerRe: Marshalling embedded array of structure from c++ to c# gives error Any idea ? Pin
DaveyM6928-Feb-10 21:48
professionalDaveyM6928-Feb-10 21:48 
QuestionPassing any object type to a function Pin
sameercodes28-Feb-10 20:12
sameercodes28-Feb-10 20:12 
Hi there,
I have a function

List<BaseEntity> ConvertList(List<BaseEntity> listBaseEntity)
{
//My code
}


Now I am calling the function as follows:
List<ChildEntity> listChild = new List<ChildEntity>();

listChild = ConvertList(listChild);

Here ChildEntity has base class as BaseEntity. On compiling I am getting error as :

Cannot convert type List<ChildEntity> to List<BaseEntity> via a reference conversion, boxing conversion, unboxing conversion, wrapping conversion, or null type conversion


Then I tried defining the function as

List<object> ConvertList(List<object> listObject)
{
//My Code
}


Again I am calling the function as follows:
List<ChildEntity> listChild = new List<ChildEntity>();

listChild = ConvertList(listChild);


Then I got the compile time error as

The best overloaded method match for ConvertList(List<object>)' has some invalid arguments


How do I resolve this issue? The list that I am passing to the ConvertList function could be of any type.
Thanks and Regards
-
Sameer
AnswerRe: Passing any object type to a function Pin
KarstenK28-Feb-10 21:31
mveKarstenK28-Feb-10 21:31 
GeneralRe: Passing any object type to a function Pin
sameercodes28-Feb-10 22:10
sameercodes28-Feb-10 22:10 
GeneralRe: Passing any object type to a function Pin
TheDudeJuan28-Feb-10 22:46
TheDudeJuan28-Feb-10 22:46 
GeneralRe: Passing any object type to a function Pin
sameercodes1-Mar-10 18:12
sameercodes1-Mar-10 18:12 
AnswerRe: Passing any object type to a function Pin
Estys1-Mar-10 2:27
Estys1-Mar-10 2:27 
GeneralRe: Passing any object type to a function Pin
sameercodes1-Mar-10 18:05
sameercodes1-Mar-10 18:05 
GeneralRe: Passing any object type to a function Pin
Estys1-Mar-10 21:07
Estys1-Mar-10 21:07 
QuestionHow to handle the localization stuff in Crystal reports XI. Pin
idreesbadshah28-Feb-10 19:23
idreesbadshah28-Feb-10 19:23 
QuestionC# and XML [modified] Pin
picasso228-Feb-10 18:16
picasso228-Feb-10 18:16 
AnswerRe: C# and XML Pin
Mycroft Holmes28-Feb-10 18:48
professionalMycroft Holmes28-Feb-10 18:48 
GeneralRe: C# and XML Pin
picasso21-Mar-10 16:40
picasso21-Mar-10 16:40 
AnswerRe: C# and XML Pin
Saksida Bojan28-Feb-10 19:03
Saksida Bojan28-Feb-10 19:03 
QuestionSave a variable Pin
suprsnipes28-Feb-10 15:15
suprsnipes28-Feb-10 15:15 
AnswerRe: Save a variable Pin
DaveyM6928-Feb-10 15:28
professionalDaveyM6928-Feb-10 15:28 
GeneralRe: Save a variable Pin
suprsnipes28-Feb-10 16:07
suprsnipes28-Feb-10 16:07 
GeneralRe: Save a variable Pin
PIEBALDconsult28-Feb-10 16:10
mvePIEBALDconsult28-Feb-10 16:10 
GeneralRe: Save a variable Pin
suprsnipes28-Feb-10 16:14
suprsnipes28-Feb-10 16:14 

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.