|
I´m working with XML at VS2003.
I have a file called Escola.xml
I´m covering it, i´d like to take the "Text" everytime that it found the element <name>.
Example:
<name>Charles
I want to show "Charles"
Can anybody help me?
Thanks
|
|
|
|
|
From memory, the property is InnerText. How are you iterating over the nodes ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I´m jrvelloso..
i just changed my name!
take a look
XmlTextReader xmltr = new XmlTextReader("Escola.xml");
while (xmltr.Read())
{
switch(xmltr.NodeType)
{
case (XmlNodeType.Element):
{
if (XmlNodeType.Element == "Name") lstLeitura.Items.Add(xmltr.Value);
break;
}
It´s wrong.. but that´s the idea that I had.
Thanks for helping!
|
|
|
|
|
I guess this is what you're looking for:
XmlTextReader xmltr = new XmlTextReader("Escola.xml");
while (xmltr.Read())
{
switch(xmltr.NodeType)
{
case XmlNodeType.Element:
if (xmltr.Name == "Name")
lstLeitura.Items.Add(xmltr.ReadString());
break;
}
}
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
That´s it man!
Thank you so VERY much!
Cheers!
|
|
|
|
|
I would personally use a XmlDocument and search for the nodes instead of iterating over the entire document, but if the doc is small, your way might be fine.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi,
I am new to C# and .Net Framework, can any one please tell how to find index of character in string.
for example: string myteststring = "abc,def";
then here can i find the index of char ",".
Warm Regards,
Mushq
|
|
|
|
|
Use the IndexOf method from the string class
All the best
Martin
|
|
|
|
|
You could try the string's method .IndexOf
VirtualVoid.NET
|
|
|
|
|
How is your response different than the one posted two hours before you?
only two letters away from being an asset
|
|
|
|
|
Mark Nischalke wrote: How is your response different than the one posted two hours before you?
Maybe it took him that long to come up with the solution, so he could not see someone else already answered the question
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
i didn't noticed that someone already answered... don't be silly, everyone can make mistake, or you're the god ?!
VirtualVoid.NET
|
|
|
|
|
Relax man, it was just a joke (my posting is marked as such with intend).
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Mark Nischalke wrote: How is your response different than the one posted two hours before you?
Actually, it was only one hour and 59 minutes.
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
I developed a windows-based application in C# ,there is a browse button, a textbox and a treeview control on the window, when i click on the browse button i can import managed DLL, the treeview control can display the classes, methods and methods parameter inside the DLL in a tree form, i want to call anyone of the method in a class in DLL at runtime,it is okay for static method but not okay for non-static method,
I used MethodBase.Invoke(object,params) for this.
Please help me so that i can create an object of the specified class and and also call that class method with the help of that class object at runtime in C#.
Thanks.
|
|
|
|
|
You can use Assembly.CreateInstance(typeName) to create an instance of a type in an assembly, and from there you can invoke methods on that instance.
|
|
|
|
|
Please help anyone.
I developed a GUI-based application in C#,there is a textbox, a browse button, a treeview and another button for firing any event, when i clicked on the browse button a OpenFileDialog is opened , i select a managed dll and import the dll, my application shows me all DLL classes and its methods and even its parameters in a treeview,now i want
to click on a method of a class and call that method.HOW?
I am using MethodBase.Invoke(object,Params) method but it is okay for Static methods, What about the non-static methods, in that case how to create the class object, PLEASE help me in this.
If someone find out a solution please forward me the code or any tip.
Thanks.
|
|
|
|
|
There are lots of sample for that.
Just look at :
http://de.gotdotnet.com/quickstart/util/srcview.aspx?path=/quickstart/howto/samples/reflection/invoke/invoke.src&file=CS\Invoke.aspx&font=3
|
|
|
|
|
|
|
Hi All
I want to debug stored procedure from visual studio. I tried a lot but in vain..
Can anybody let me know how can i ....
I have windows XP,sqlserver 2005 ,Dot net 2005
Atul Kumar
|
|
|
|
|
|
Thanx a lot
It helped me a lot..
One more thing
Is it possible to debug stored procedure when debugging out code from visual studio like pressing F11 while debugging code and debugger can reach on stored procedure statement .....
Regards
Atul
|
|
|
|
|
Hi All,
am having a query related to connection pooling.
Anyone of u pls suggest me where to place or write the code related to conection pooling.from the asp code behind,am able to know only one attribute of connection i.e connection.timedout.
so,pls suggest me the remaining attribs like maxpool,minpool etc.and where to place them
Have a nice day
|
|
|
|
|
Kush Bobby wrote: pls suggest me the remaining attribs like maxpool,minpool etc.and where to place them
Unless you are having performance problems I would just leave them with their default values.
|
|
|
|