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

C#

 
GeneralRe: program to find out whether Excel has been installed or not Pin
mav.northwind18-May-05 22:58
mav.northwind18-May-05 22:58 
GeneralRe: program to find out whether Excel has been installed or not Pin
ksanju100019-May-05 18:56
ksanju100019-May-05 18:56 
GeneralConnecting to *.Dbf files Pin
V.18-May-05 21:56
professionalV.18-May-05 21:56 
Generaldelete a registry key by unistalling of my application Pin
Anonymous18-May-05 21:42
Anonymous18-May-05 21:42 
GeneralCreateFile Problem Pin
Mohan vijay18-May-05 21:20
Mohan vijay18-May-05 21:20 
GeneralMultiple Image Printing Problem Pin
ismart18-May-05 21:10
ismart18-May-05 21:10 
GeneralCommunication between Modems Pin
Subrahmanyam K18-May-05 20:44
Subrahmanyam K18-May-05 20:44 
Generalpls correct my error Pin
ksanju100018-May-05 20:41
ksanju100018-May-05 20:41 
hi
this is my code which is working fine
but when i want to put user defined value from textbox to @name='here ib place of ram'
i get a sysntax error

XmlDocument doc = new XmlDocument();
doc.Load("c:/farm-config.xml");
xmlNode farm2=doc.SelectSingleNode("/root/farm-config/farm[./@name='ram']/connection/@address");
MessageBox.Show("sanjeev" + farm2.InnerText);
This is working fine

when i modify code
it gives some syntax error
xmlNode farm2=doc.SelectSingleNode("/root/farm-config/farm[./@name="+ textBox1.text + "]/connection/@address");

i tried this one also
xmlNode farm2=doc.SelectSingleNode("/root/farm-config/farm[./@name='"+ textBox1.text + "']/connection/@address");

can anyone correct me

this is my xml file sturcure
<?xml version="1.0" encoding="UTF-8"?>
<root>
<farm-config>
<farm name="good">
<connection address="localhost" user="god1" password="mad">
<lastjob>Copy-All</lastjob>
<lastconnection startdate="2005-05-10" starttime="12:43:23" enddate="2005-05-10" endtime="12:58:32" />
<state>1</state>

</connection>
</farm>
<farm name="sanjay">
<connection address="127.0.0.1" user="dog" password="cat">
<lastjob>Copy-All</lastjob>
<lastconnection startdate="2005-05-10" starttime="12:43:23" enddate="2005-05-10" endtime="12:58:32" />
<state>1</state>

</connection>
</farm>
<farm name="ram">
<connection address="localhost1" user="root" selectedConnection="1" password="daask">
<lastJob>Copy-All</lastJob>
<lastConnection startdate="2005-05-10" starttime="12:43:23" enddate="2005-05-10" endtime="12:58:32" />
<state>1</state>
</connection>

</farm>
</farm-config>
</root>
regards
sanjeev

GeneralRe: pls correct my error Pin
Ali Iqbal Khan18-May-05 23:32
Ali Iqbal Khan18-May-05 23:32 
Generalmultiple SQl on mySQL Pin
Jassim Rahma18-May-05 20:26
Jassim Rahma18-May-05 20:26 
GeneralRe: multiple SQl on mySQL Pin
MoustafaS18-May-05 23:09
MoustafaS18-May-05 23:09 
GeneralProblem with namespaces/references Pin
methodincharge18-May-05 19:21
methodincharge18-May-05 19:21 
GeneralRe: Problem with namespaces/references Pin
Christian Graus18-May-05 19:41
protectorChristian Graus18-May-05 19:41 
GeneralRe: Problem with namespaces/references Pin
methodincharge19-May-05 2:24
methodincharge19-May-05 2:24 
GeneralRe: Problem with namespaces/references Pin
Christian Graus19-May-05 12:49
protectorChristian Graus19-May-05 12:49 
GeneralEmpty HttpWebResponse length for some urls Pin
Jason Manfield18-May-05 17:41
Jason Manfield18-May-05 17:41 
GeneralTwain or WIA Pin
g00fyman18-May-05 16:57
g00fyman18-May-05 16:57 
GeneralRe: Twain or WIA Pin
Christian Graus18-May-05 17:34
protectorChristian Graus18-May-05 17:34 
GeneralRe: Twain or WIA Pin
g00fyman18-May-05 17:46
g00fyman18-May-05 17:46 
GeneralRe: Twain or WIA Pin
Christian Graus18-May-05 18:02
protectorChristian Graus18-May-05 18:02 
GeneralRe: Twain or WIA Pin
g00fyman18-May-05 18:09
g00fyman18-May-05 18:09 
GeneralRe: Twain or WIA Pin
Luis Alonso Ramos18-May-05 18:13
Luis Alonso Ramos18-May-05 18:13 
GeneralRe: Twain or WIA Pin
Christian Graus18-May-05 18:13
protectorChristian Graus18-May-05 18:13 
GeneralRe: Twain or WIA Pin
g00fyman18-May-05 18:25
g00fyman18-May-05 18:25 
GeneralRe: Twain or WIA Pin
Luis Alonso Ramos18-May-05 18:37
Luis Alonso Ramos18-May-05 18:37 

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.