h1.post-title { color:orange; font-family:verdana,Arial; font-weight:bold; padding-bottom:5px; text-shadow:#64665b 0px 1px 1px; font-size:32px; } -->

Pages

Select All string in TextBox using C#.Net

Copy and Paste this Code in your TextBox Keydown Event

if ((e.Control == true) && (e.KeyCode == Keys.A))
{
textBox1.SelectAll();
}

Cannot set a value on node type 'Element'

         Today , we discussed "Cannot set a value on node type 'Element' "
Suppose user are using below code in the below Structure:

TamilNadu private void ChangeValueofXMLNodeValue(string XMLPath,string SelectedSingleTag)
{
XmlDocument doc = new XmlDocument();
doc.Load(XMLPath);
XmlNode root = doc.DocumentElement;
XmlNode myNode = root.SelectSingleNode(SelectedSingleTag);
myNode.Value = textBox1.Text ;
doc.Save(XMLPath);
}
you will get "Cannot set a value on node type 'Element'." Solution: myNode.Value = textBox1.Text ; change myNode.InnerText = textBox1.Text ;

Set Value for SingleXMLNode usng C#.Net

            Today, we will discuss about "Set Value for SingleXMLNode usng C#.Net"
 Copy and Paste the Following Code

private void ChangeValueofXMLNodeValue(string XMLPath,string SelectedSingleTag) { XmlDocument doc = new XmlDocument(); doc.Load(XMLPath); XmlNode root = doc.DocumentElement; XmlNode myNode = root.SelectSingleNode(SelectedSingleTag); myNode.InnerText = textBox1.Text ; doc.Save(XMLPath); }