Click here to Skip to main content
15,920,603 members
Home / Discussions / C#
   

C#

 
AnswerRe: button click through another program Pin
Christian Graus1-Jan-09 2:59
protectorChristian Graus1-Jan-09 2:59 
AnswerRe: button click through another program Pin
Silvyster1-Jan-09 12:43
Silvyster1-Jan-09 12:43 
GeneralRe: button click through another program Pin
Deresen1-Jan-09 21:14
Deresen1-Jan-09 21:14 
AnswerRe: button click through another program Pin
Eddy Vluggen2-Jan-09 2:03
professionalEddy Vluggen2-Jan-09 2:03 
GeneralRe: button click through another program Pin
Deresen2-Jan-09 2:14
Deresen2-Jan-09 2:14 
GeneralRe: button click through another program Pin
Eddy Vluggen2-Jan-09 2:26
professionalEddy Vluggen2-Jan-09 2:26 
GeneralRe: button click through another program Pin
Deresen2-Jan-09 2:31
Deresen2-Jan-09 2:31 
QuestionObject reference not set to an instance of an object.? Pin
dec821-Jan-09 2:06
dec821-Jan-09 2:06 
i have a class
public class Command
{
public int Number;
public int Parameters;
}

then 1 xml file :

<common>
<command number="0">
<response parameters="2">

<command number="1">
<response parameters="5">

i wanna assign attribute of the class to value in xml file:


Command[] Response = new Command[200];

XmlDocument Reader = new XmlDocument();
Reader.Load("Sample.xml");
XmlNodeList List = Reader.SelectNodes("/Common/Command");

foreach (XmlNode commandnode in List)
{
int i = int.Parse(commandnode.Attributes["value"].InnerText);
Response[i] = new Command();
HartResponses[i].Number = i;

XmlNodeList Child1List = commandnode.ChildNodes;
foreach (XmlNode Child1 in Child1List)
{
if (Child1.Name == "Response")

Response[i].Parameters = int.Parse(Child1.Attributes ["Parameters"].InnerText);


}}


i got error :"Object reference not set to an instance of an object" at the line
Response[i].Parameters = int.Parse(Child1.Attributes["Parameters"].InnerText);
The code can be executed with i=0,but when i increase to 1, i got this error?
How do i solve it?
Thanks
AnswerRe: Object reference not set to an instance of an object.? Pin
Christian Graus1-Jan-09 2:08
protectorChristian Graus1-Jan-09 2:08 
GeneralRe: Object reference not set to an instance of an object.? Pin
dec821-Jan-09 2:10
dec821-Jan-09 2:10 
GeneralRe: Object reference not set to an instance of an object.? Pin
Christian Graus1-Jan-09 2:36
protectorChristian Graus1-Jan-09 2:36 
GeneralRe: Object reference not set to an instance of an object.? Pin
dec821-Jan-09 2:59
dec821-Jan-09 2:59 
GeneralRe: Object reference not set to an instance of an object.? Pin
Christian Graus1-Jan-09 3:08
protectorChristian Graus1-Jan-09 3:08 
GeneralRe: Object reference not set to an instance of an object.? Pin
dec821-Jan-09 3:58
dec821-Jan-09 3:58 
QuestionCrystal Report Designer Pin
spiritboy31-Dec-08 23:19
spiritboy31-Dec-08 23:19 
Question[newbie] [error] must declare a body because it is not marked abstract, extern, or partial Pin
jon-8031-Dec-08 23:01
professionaljon-8031-Dec-08 23:01 
AnswerRe: [newbie] [error] must declare a body because it is not marked abstract, extern, or partial Pin
beatles169231-Dec-08 23:25
beatles169231-Dec-08 23:25 
Questionadding 2 hashtable Pin
tejesh12331-Dec-08 20:48
tejesh12331-Dec-08 20:48 
AnswerRe: adding 2 hashtable Pin
Christian Graus1-Jan-09 2:09
protectorChristian Graus1-Jan-09 2:09 
AnswerRe: adding 2 hashtable Pin
User 66581-Jan-09 2:56
User 66581-Jan-09 2:56 
QuestionCustom control's property problem Pin
Xmen Real 31-Dec-08 18:35
professional Xmen Real 31-Dec-08 18:35 
AnswerRe: Custom control's property problem Pin
beatles169231-Dec-08 23:28
beatles169231-Dec-08 23:28 
GeneralRe: Custom control's property problem Pin
Xmen Real 31-Dec-08 23:31
professional Xmen Real 31-Dec-08 23:31 
AnswerRe: Custom control's property problem Pin
Pedram Behroozi1-Jan-09 0:49
Pedram Behroozi1-Jan-09 0:49 
GeneralRe: Custom control's property problem Pin
Xmen Real 1-Jan-09 0:55
professional Xmen Real 1-Jan-09 0:55 

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.