write a sample code make use of xmltext writer
Answer / career.tina@yahoo.co.in
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
try
{
//creating a apth for writing xml
string xml1 = Server.MapPath("test2.xml");
//initialising xmlwriter
XmlTextWriter xt = new XmlTextWriter(xml1,
System.Text.Encoding.UTF8);
xt.Formatting = System.Xml.Formatting.Indented;
//start writing it
xt.WriteStartDocument();
//element
xt.WriteStartElement("name");
// attribute
xt.WriteAttributeString("my_name", "name");
xt.WriteStartElement("phn");
xt.WriteAttributeString("my_phn", "266549560");
xt.WriteStartElement("id");
xt.WriteAttributeString("my_id", "100");
xt.WriteStartElement("city");
xt.WriteAttributeString("my_city", "city");
xt.WriteElementString ("title","gud girl");
//ending all elements
xt.WriteEndElement ();
xt.WriteEndElement();
xt.WriteEndElement();
xt.WriteEndElement();
xt.WriteEndDocument();
xt.Close ();
}
catch
{
}
}
}
Is This Answer Correct ? | 3 Yes | 0 No |
Explain an object, class and method.
on modify statement, executeNonQuery returns zero rows affected even though there has been modification carried out sucessfully in the table.. can anyone tell me is this possible??? if yes, how..???
What are validator? Name the Validation controls in asp.net? How do u disable them?
How many types of file extensions for razor views in ASP.Net MVC?
What are the different types of events are occured when a client requests an ASP.NET page from IIS server?
0 Answers Sans Pareil IT Services,
Can you give an example of what might be best suited to place in the Application_Start and Session_Start subroutines?
To display data in a Repeater control which template you provide?
Which is an advantage of application service providers?
If Instancing = Single use for ActiveX Exe, how will this be executed if there are 2 consecutive client requests ?
What is viewstate? What does the “enableviewstate” property do?
Describe the diffeerence between inline and code behind?
What are the events in a page life cycle?