|
Modify your post and check the "Ignore HTML tags in this message (good for code snippets)" checkbox at the bottom so we can all see the xml.
|
|
|
|
|
Hi All,
My question is how can i replace a value in XMl in C#, directly accesiing that node.
(e.g)
<?xml version="1.0"?>
<configurationsettings xmlns:dt="urn:schemas-microsoft-com:datatypes">
<connectionstring>
<userid>test123</userid>
</connectionstring>
</configurationsettings>
here i want to replace the value "test123" to some other value, how can i achieve this .will anyone help in this
thanks
Umashanker.K
|
|
|
|
|
Load the XML into a XmlDocument , use the SelectSingleNode to select the userid node and change its value via an appropriate property of the XmlNode instance returned by SelectSingleNode . Take a look at the documentation of the mentioned classes and method and the continuative links. Their are many examples and personally I think their use is straightforward.
"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
|
|
|
|
|
Hi All,
I want to know how can i replace a value in a XML (e.g)
<configurationsettings xmlns:dt="urn:schemas-microsoft-com:datatypes">
<connectionstring>
<userid>test123
Here in this example i want to replace the value of "userid" form "test123" to some other value. I want to access the node directly. How can i acheive this in C#.
Will anyone help me..
Thanks in advance
Umashanker.k
|
|
|
|
|
Load it into an XmlDocument and use XPath to find/replace the value.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
OK, this is obscure.
I've got a remoting service that creates a form, and I've got remoting client that needs to hide and show the form. Calling Show or Hide occasionally never returns.
I've verified that that thread ID is the same that created the form and is now calling Show/Hide on the remote server. Though I'm wondering if that's a problem.
BTW, the Form was created with a factory method, so we're not dealing with Singleton or SingleCall lifetime issues, though we may be dealing with lifetime issues for other reasons. Hmmm.
Anyways...anyone have even a clue what might be the problem?
Thanks!
Marc
Thyme In The CountryInteracxPeople are just notoriously impossible. --DavidCrow There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith
|
|
|
|
|
I'm not sure I understand: the .NET remoting server creates the form and sends that to the client?
In any case, my guess is either your service object lifetime is expired, you're talking to the form on the wrong thread, or the form was created on an MTA thread.
|
|
|
|
|
This is my problem:
I have these classes:
public Class C<br />
{<br />
<br />
}<br />
<br />
public abstract Class A<br />
{<br />
protected C;<br />
}<br />
<br />
public Class D : C<br />
{<br />
}<br />
<br />
public Class B : A<br />
{<br />
private D;<br />
}
When I do this: B = new B(); , I have D AND C in B.
And I need ONLY ONE, which is the newer one - D.
How can I make the Class A use the new one (D) insted of the old one?
|
|
|
|
|
Does anyone knows where I can find a free telnet library for C#? I meant a complete source in which I can use methods as connect(), sendData() or disconnect(), for example.
I need to establish communication with a server.
Thanks!
Mauricio
|
|
|
|
|
A little Google goes a long way. Results for "c# telnet library"[^]
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Thanks Dave.
I've been in every result that google give. The problem is that many of them are incomplete libraries and others are extremely complicated.
I was wondering if any of you knows or recommends one library in particular.
|
|
|
|
|
mperazac wrote: others are extremely complicated.
Only you are going to know if it's extremely complicated or not. You could get recommendations for everything you've already seen. It's probably going to be up to you to just bite the bullet and use one of the complicated ones.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
I'm looking to allow the user to make changes to a database. Basically, I have a DataGridView and a bunch of text boxes to allow the user to view all relevant fields on the DataGridView on one form. Both the text boxes and the DataGridView are bound to a DataTable and to a BindingManagerBase.
I want the user to be able to make multiple edits to the database and then click 'Save' to save any and all changes he/she has made since the last time the database was saved. I'm filtering the rows by DataRowState and only updating those rows that are DataRowState.Modified. Well, this works OK, except that if the user is editing the row he is currently viewing, it seems the data is not validated as being part of the DataTable, so the row is not considered Modified. If the user switches rows to an unedited row prior to clicking 'Save', then all changes are saved, but forcing a user to do that is not ideal, to say the least.
Any feedback would be appreciated. Thanks.
|
|
|
|
|
Hi.
What do you think about J#?
Have you ever done any important project using J#? Why should(n't) we use it? Is it worth any attention at all?
It's one of just 4 official .NET languages and yet Code Project doesn't have a forum dedicated to it.
Is J# just a big waste of time and money from Microsoft in order to feed their fat ego?
|
|
|
|
|
|
blackjack2150 wrote: Is J# just a big waste of time and money from Microsoft in order to feed their fat ego?
J# was created to make it easier to port from java .net. While it might've been used a fair amount in that role back in 02 by people who originally wrote their apps in j++ before sun killed it, no one's using it anymore so MS has decided to stop developing it.
--
CleaKO The sad part about this instance is that none of the users ever said anything [about the problem].
Pete O`Hanlon Doesn't that just tell you everything you need to know about users?
|
|
|
|
|
Hi
I’m creating one windows service in my own purpose
Using msxml4.dll.
The process of service is to fetch the data from exchange server through webdav SEARCH METHOD
When i use this coding in windows form normal button click event , it works fine,
When I convert into windows service, it throws the error
The coding is below
MSXML2.XMLHTTP objXMLHTTP = new MSXML2.XMLHTTP();
writemethod("After Initialize");
System.Xml.XmlDataDocument xmlDOMParams = new System.Xml.XmlDataDocument();
objXMLHTTP.open("SEARCH", strInboxURL,false,strAliasName, strPassword);
objXMLHTTP.setRequestHeader("Content-type", "text/xml");
objXMLHTTP.setRequestHeader("Depth", "1");
string strXML;
strXML = "" +
" = \'DAV:\'>" +
"" +
"SELECT \"urn:schemas:httpmail:fromemail\"," +
------------------
---------etc…
objXMLHTTP.send(strXML); // Error Raised
The Error Raised in when i send the xml query
Any suggestion,please reply
We are using c#
Regards,
Arunkumar S
|
|
|
|
|
Yes
finally i identify the problem
the problem caused in path of the inbox
instead of ip address, i use hostname
ex. http://xx.xx.xx.xx/exchange/emailaddress/inbox
we use
http://hostname/exchange/emailaddress/inbox
|
|
|
|
|
Hi, I have been looking for a simple, free, forum software download I can use. I have had problems with "Yet another forum" and "Jumpy Forum". My preference would be a .NET 1.1 or 2.0 (even better) application in C#. I've scoured the Internet, but no luck so far. Could anybody please recommend one?
Thanks
|
|
|
|
|
Isn't phpBB good for you?
|
|
|
|
|
I'll check that out, thanks.
|
|
|
|
|
Hi!
I am trying to creat the body for an email. First I create the text of the email like this:
System.Text.StringBuilder sbBody = new System.Text.StringBuilder();
sbBody.Append(" asdasfsdgfdfg dfgh \r\n");
sbBody.Append("fw4 34wtrc345v345345gv43bv3 \r\n");
sbBody.Append("asdasdaskjfn39i4fn3498gn4oegerlkg. \r\n");
Then I start a process that launches the email client. The problem is that the text of the email is not displayed correctly in Outlook, meaning that the \r\n are ignored(if I display the text in a message box the \r\n work fine). Can anyone help me with this problem...
PS: I have tried using Convert.toChar(13) but still nothing...
|
|
|
|
|
If it's in HTML view, \r\n won't have any effect. You'd need a <br /> tag there instead.
Regards,
Nish
Fly on your way like an eagle
Fly as high as the sun
On your wings like an eagle
Fly and touch the sun
|
|
|
|
|
I have tried adding <BR> instead of \r\n...but in this case it just displays <BR> in the text...this means that it is not in HTML view mode
|
|
|
|
|
How are you sending the mail body to the process?
---
single minded; short sighted; long gone;
|
|
|
|