|
private void initialization()
{
Command[] Querries = new HARTCommand[50];
XmlDocument Reader = new XmlDocument();
Reader.Load("Myfile.xml");
XmlNodeList List = Reader.SelectNodes("/Common/Command");
foreach (XmlNode commandnode in List)
{
int i = int.Parse(commandnode.Attributes["value"].InnerText);
int type= int.Parse(commandnode.Attributes["Para"].InnerTect);
Querries[i] = new Command();
Querries[i].CommandNumber = i;
Querries[i].NoOfParameters= type;
}
}
I run the code ,and the initialization is working fine.
|
|
|
|
|
sorry, corrected one is here
private void initialization()
{
Command[] Querries = new Command[50];
XmlDocument Reader = new XmlDocument();
Reader.Load("Myfile.xml");
XmlNodeList List = Reader.SelectNodes("/Common/Command");
foreach (XmlNode commandnode in List)
{
int i = int.Parse(commandnode.Attributes["value"].InnerText);
int type= int.Parse(commandnode.Attributes["Para"].InnerTect);
Querries[i] = new Command();
Querries[i].CommandNumber = i;
Querries[i].NoOfParameters= type;
}
}
I run the code ,and the initialization is working fine.
|
|
|
|
|
The problem you have is because "Querries" is defined as a class-level property, but you're redefining it as a local variable in the initialization method. This locval copy is the one you're initializing, not the class-level one you go on to try to use.
|
|
|
|
|
thanks , but Even if i put whole dose of initialization inside button_Click(object sender, EventArgs e), it is still the same ?
|
|
|
|
|
Thanks, ALready solve it
|
|
|
|
|
There must be dozens of your classmates that have already asked this question here. Just because you make the space for 50 instances of your object, doesn't at all mean that you've instantiated the object 50 times. For christ's sake, read your freakin' text books.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Do not be mad. In fact, the real problem is that the var he defined in Initializer method override the class field. Maybe the code is not clear enough.
Tan Li
I Love KongFu~
|
|
|
|
|
Dear all,
Application developed using VS2005 c#, and deployed using click-once, In one of the pc the application runs perfect first time, but when we restart the pc application throws below error message:
ApplicationName.exe .net framework inilization error
Unable to find a runtime version to run this application
But It runs fine with other PC's , only this PC have problem,
I have already googled but not found any solutions for the problem.
Please help....
Thanks & Regards,
Bhaskar Shetty
Bhaskar Shetty
|
|
|
|
|
Hi,
maybe the .NET framework is needed?
|
|
|
|
|
Hi,
.net framework and all pre-requets are already installed.
Is it becuase of any virus infection??
Thanks & Regards,
Bhaskar Shetty
|
|
|
|
|
Probably not, though without scanning the machine with virus software, there's really no way to tell.
Your other option is to rebuild the PC, since this is a really strange problem. I've never seen this happen before.
|
|
|
|
|
Hi,
Even tried Re-building the whole PC's, but problem persists...
Thanks & Regards,
Bhaskar Shetty
|
|
|
|
|
Man, you have a shetty understanding of computers, don't you.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
What do you mean by this...
Bhaskar Shetty
|
|
|
|
|
He means to troll...like a good outlaw programmer.
|
|
|
|
|
well
that's probably a virus, which i still can't pinpoint, or find a solution for
1 - my home pc was infected and it gave 0xc000007b error (initialization error) something like that to alll .net built assemblies
2 - now i have my pc at work who is infected, and gives me the error you just described.
Now can you confirm that when you rebuild one of your own assemblies, and try to run it ...it runs correctly and after you close it, a couple of minutes, the file size changes just like that, and the problem starts?
if you insert a USB drive, you'll have two infected files on it, they are hidden ... the first is 'autorun.inf' and the second is totally random, having an executable extension (such as .exe, .pif, ......)?
|
|
|
|
|
Full c# code to change computer name which connected to domain.
suppose :
domain name : dca.auh
username : mshan --- (this user have permission to connect to domain and change computer settings )
password : 123
I need it URGENTLY
Thaks allot for help
Thanks & Regards
|
|
|
|
|
mshannaq wrote: I need it URGENTLY
Good. So what have YOU tried, or do you expect someone else to do your job for you?.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
mshannaq wrote: I need it URGENTLY
Of course you do. Why else would you post a question at CP before even checking Google[^]?
/ravi
|
|
|
|
|
If it is so urgent why don't you Google? I didn't know how to rename computer but I found it using Google. Why should others search instead of you?
|
|
|
|
|
mshannaq wrote: Full c# code to change computer name which connected to domain.
suppose :
domain name : dca.auh
username : mshan --- (this user have permission to connect to domain and change computer settings )
password : 123
I need it URGENTLY
Thaks allot for help
Good use of capitals there. That obviously makes it much more important than "urgently". Perhaps you should have used bold in there as well to really get the point across.
Now, for your New Years Resolution, I want you to learn that this isn't RentACoder.
|
|
|
|
|
OMFG...
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Im sorry !
I read about this web site that its help you.
Sence one week im traying to do this code but for now its not correct.
I search alot but all is not working.
Im new in C#
this last time i will use this fourms because it contain bad people here ...
Advice specialy to Mr.John Simmons : make program to bring water to your Ass because its need to be clean.
KISS YOUR MOTHER ASS
|
|
|
|
|
mshannaq wrote: this last time i will use this fourms because it contain bad people here ...
Good. Don't let the door hit you in the ass on your way out. And yes, we're all very bad here.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
suck a drink from your mother pussy
|
|
|
|