Saturday, January 29, 2011

WPF generate xml file for list view data to save in database.

   /**********Generatating XML**********/
            string strEmploymentInfoListObject = "";
            System.Xml.Serialization.XmlSerializer x = new System.Xml.Serialization.XmlSerializer(ticket.ListOfTicket.GetType());
            MemoryStream memoryStream = new MemoryStream();
            XmlTextWriter xmlWriter;
            xmlWriter = new XmlTextWriter(memoryStream, Encoding.UTF8);
            xmlWriter.Namespaces = true;
            x.Serialize(xmlWriter, ticket.ListOfTicket);
            string xml;
            xml = Encoding.UTF8.GetString(memoryStream.GetBuffer());
            xml = xml.Substring(xml.IndexOf(Convert.ToChar(60)));
            xml = xml.Substring(0, (xml.LastIndexOf(Convert.ToChar(62)) + 1));
            strEmploymentInfoListObject = xml;

            /****** Checking The XML Data is Generate or not ********/

SQL Get all Index create script from Database

To get all script from database as a create new index into another database you can use the following --Get all Index Script SELECT...