Click here to Skip to main content
15,904,346 members
Home / Discussions / C#
   

C#

 
Generalcasting struct to list<object></object> Pin
manowj4-Nov-09 23:43
manowj4-Nov-09 23:43 
GeneralRe: casting struct to list Pin
OriginalGriff5-Nov-09 0:14
mveOriginalGriff5-Nov-09 0:14 
And your problem is?


Looking at it, you are getting a "object not set to an instance of an object" exception, I suspect. Try:
{
   Emp emp1 = new Emp();
   Operation op = new Operation();
   op.ListText = new List<object>();
   emp1.EmpID = 1;
   emp1.EmpName = "Manoj";
   op.success = true;
   op.msg = "pass";
   op.ListTest.Add(emp1);
}

Or, by preferance, convert it to a class and handle it's internals better yourself!

BTW: use <pre> and </pre> blocks to preserve your formatting in future. It isn't too bad with a tiny fragment like this, but later...

No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.

This message is made of fully recyclable Zeros and Ones

GeneralRe: casting struct to list [modified] Pin
manowj5-Nov-09 0:35
manowj5-Nov-09 0:35 
GeneralRe: casting struct to list Pin
OriginalGriff5-Nov-09 0:53
mveOriginalGriff5-Nov-09 0:53 
QuestionRead text from notepad in c# Pin
krinaljariwala4-Nov-09 22:43
krinaljariwala4-Nov-09 22:43 
AnswerRe: Read text from notepad in c# Pin
Covean4-Nov-09 23:16
Covean4-Nov-09 23:16 
GeneralRe: Read text from notepad in c# Pin
krinaljariwala4-Nov-09 23:38
krinaljariwala4-Nov-09 23:38 
GeneralRe: Read text from notepad in c# Pin
Covean4-Nov-09 23:44
Covean4-Nov-09 23:44 
GeneralRe: Read text from notepad in c# Pin
krinaljariwala5-Nov-09 0:04
krinaljariwala5-Nov-09 0:04 
QuestionExplanation on "DSO" Pin
Joe Rozario4-Nov-09 22:25
Joe Rozario4-Nov-09 22:25 
AnswerMessage Closed Pin
4-Nov-09 22:30
stancrm4-Nov-09 22:30 
GeneralRe: Explanation on "DSO" Pin
Joe Rozario4-Nov-09 22:40
Joe Rozario4-Nov-09 22:40 
GeneralMessage Closed Pin
4-Nov-09 22:43
stancrm4-Nov-09 22:43 
GeneralRe: Explanation on "DSO" Pin
Joe Rozario4-Nov-09 22:56
Joe Rozario4-Nov-09 22:56 
GeneralMessage Closed Pin
4-Nov-09 23:02
stancrm4-Nov-09 23:02 
GeneralRe: Explanation on "DSO" Pin
Joe Rozario4-Nov-09 23:24
Joe Rozario4-Nov-09 23:24 
GeneralMessage Closed Pin
5-Nov-09 1:08
stancrm5-Nov-09 1:08 
GeneralRe: Explanation on "DSO" Pin
Joe Rozario5-Nov-09 1:11
Joe Rozario5-Nov-09 1:11 
AnswerRe: Explanation on "DSO" Pin
Shameel5-Nov-09 2:43
professionalShameel5-Nov-09 2:43 
GeneralRe: Explanation on "DSO" Pin
Joe Rozario5-Nov-09 17:00
Joe Rozario5-Nov-09 17:00 
Questionadd row to SQL Data source column at run time? Pin
obarahmeh4-Nov-09 21:47
obarahmeh4-Nov-09 21:47 
QuestionObject- or Data-bind List to ListView? Pin
Gonso774-Nov-09 21:07
Gonso774-Nov-09 21:07 
AnswerRe: Object- or Data-bind List to ListView? Pin
Mycroft Holmes4-Nov-09 21:42
professionalMycroft Holmes4-Nov-09 21:42 
GeneralRe: Object- or Data-bind List to ListView? Pin
Gonso776-Nov-09 0:07
Gonso776-Nov-09 0:07 
Questionhow to give color in contextmenustrip in c# Pin
Matsyendra4-Nov-09 20:53
Matsyendra4-Nov-09 20:53 

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.