ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
info       Did you received any Funny E-Mails from your Friends and like to share with rest of our friends? Yeah!! you can post that stuff   HERE
Google
 
Categories  >>  Software  >>  Microsoft Related  >>  ASP.NET
 
 


 

 
 Visual Basic interview questions  Visual Basic Interview Questions
 C Sharp interview questions  C Sharp Interview Questions
 ASP.NET interview questions  ASP.NET Interview Questions
 VB.NET interview questions  VB.NET Interview Questions
 COM+ interview questions  COM+ Interview Questions
 ADO.NET interview questions  ADO.NET Interview Questions
 IIS interview questions  IIS Interview Questions
 MTS interview questions  MTS Interview Questions
 Crystal Reports interview questions  Crystal Reports Interview Questions
 BizTalk interview questions  BizTalk Interview Questions
 Dot Net interview questions  Dot Net Interview Questions
 Exchange Server interview questions  Exchange Server Interview Questions
 SharePoint interview questions  SharePoint Interview Questions
 Microsoft Related AllOther interview questions  Microsoft Related AllOther Interview Questions
Question
write a sample code make use of xmltext writer
 Question Submitted By :: Career.tina@yahoo.co.in
I also faced this Question!!     Rank Answer Posted By  
 
  Re: write a sample code make use of xmltext writer
Answer
# 1
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
Career.tina@yahoo.co.in
 

 
 
 
Other ASP.NET Interview Questions
 
  Question Asked @ Answers
 
what is DLL Hell and how it is solved in .NET? icegen9
What r the page life cycle in asp.net page?  1
What is the use of location tag in web.config file Karur-Vysya-Bank-KVB1
What benefit does your code receive if you decorate it with attributes demanding specific Security permissions?  2
How you will handle session when deploying application in more than a server? Describe session handling in a webfarm, how does it work and what are the limits? CoreObjects2
What is view state and how this can be done and was this there in asp ? Accenture1
Difference between Dataset and DataReader ? Accenture4
what is diffgram ?  1
2. Why did you choose this career? Swatz-Oils1
difference between caching objects in session objects?  2
Can you explain the difference between an ADO.NET Dataset and an ADO Recordset?  2
Interface have Default Modifier Is 'Public'.Where We Will Use The KeyWord In Interface? Phoenix-Technologies3
What is difference b/w Data Grid in ASP.Net 1.1 and Gridview in 2.0 IntraLogic9
Derive WSDL?  6
How to retrieve the information from datatable citywise in c#? HCL2
what are the types of ASP objects ? Satyam4
What is a bubbled event?  2
what is dumpbin.exe?  1
How to do Caching in ASP?  1
what r the Templeats in ASP.net? Intel5
 
For more ASP.NET Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com