.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Add root xsi attributes to existing documents

Posted By:      Posted Date: August 28, 2010    Points: 0   Category :Sql Server
I am looking for a way to perform a table update of an XML column containing strongly typed data. Recently, we modified our schema to include xmlns:xsi and xsi:schemaLocation. The thousands of documents already in the table, do not contain these new root element attributes, and I would like to add them. Sample old xml doc: <ROOT xmlns="http://www.xyz.com"><br/> <TAG>12345</TAG><br/> </ROOT>   Sample new xml doc: <ROOT xmlns="http://www.xyz.com"<br/> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <br/> xsi:schemaLocation="http://www.xyzcom/schemas/A http://www.xyz.com/schemas/A/a.xsd"><br/> <TAG>12345</TAG><br/> </ROOT> Any thoughts or suggestions on how this might be accomplished?

View Complete Post

More Related Resource Links

XmlSerializer - how to define class to not generate attributes in root element?

Hi! I have simple class that I serialize to xml file: <?xml version="1.0" encoding="utf-8"?> <MyRootElement xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Area="East">   <Products>     <SalesProduct Taxable="true">       <Name>Sofa</Name>     </SalesProduct>     <Product>       <Name>Television</Name>     </Product>   </Products> </MyRootElement> I don`t want have in xml file attributes xmlns:xsi and xmlns:xsd. How can I define class to not have these two attributes in xml file? I tried use XmlRoot attribute but there is no control for these two attributes. They are always generated. Regards

How do I create an SPD workflow for all existing documents in doc lib?

Hi All, Could someone help me? I am newbie to sharepoint and workflow. I want to write a work flow library to send email to user bi annually. I have tried and not successful. My workflow doesn't applied to existing documents and it doesn't send mail to existing document owner and it stopped sending mail after one or two times. I am using sharepoint designer 2007. Here are work flow steps 1)      Workflow need to start automatically when attach to DL 2)      If there are some documents already in DL, this WF needs to be applied to all existing documents. 3)      When workflow starts, it will send email to document owner to review their existing documents or new document loaded 4)      Send reminder after one week if document owner doesn't review their document 5)      If user doesn't review the document (check out, check in) after 2 week, it will automatically check out and check in with document owner account 6)      After 6 months from that time, workflow will send email again to document owner to review 7)      Step 3 to 6 will loop.   Any suggestion? I am looking forward any help.   Thanks.Best Regards

XML file - write attributes in root element


i have to write the following XML file using .net 2005.

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>

- <IMPORTFILE xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ARC_Carrier_Import.xsd">

Serializing attributes at the message root level


Hi All,

I rarely find the need to post to a forum, but I have encountered an issue that I just can't resolve. I need to send and receive a message via WCF with the following structure:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Header />
    <SignRequest RequestID="_1234" Protocol="urn:protocol">

I can use a MessageContract to control the root element (the SignRequest) but attempting to add Attributes (as per http://msdn.microsoft.com/en-us/library/ms733901(v=VS.90).aspx ) causes the XmlSerializer to throw an exception complaining that I can't use the XmlAttribute attribute. I can use the XmlSerializer in it's raw form but then I don't seem to have control over the root element (a 'wrapping' element with the method name is added).

At this stage, I'd be happy to use message contracts, the XmlSerializer or any combination of the above! If anyone has any pointers, I would very much appreciate it.



Web Service for uploading documents into SharePoint

WS UploadService is a web service written for Microsoft Office SharePoint Server 2007 and Windows SharePoint Services 3.0 and is meant for uploading documents into SharePoint. I have just uploaded the zip file to GotDotNet.com so it will take some time before the zip file appears in the list of downloads. For the time being, you can download the zip file from the following location

URL Routing and Existing HttpHandler problems


Hello everyone,

I have a problem:

I am currently using 2 features: 

1. HttpHandler

Registering the path="res.aspx" verb="*"

2. URL Routing:

Registering with this pattern: "Company/Edit/{*companyId}","~/CompanyEdit.aspx"

In my CompanyEdit.aspx page, I used httphandler res.aspx to generate some images at client.

  • res.aspx?img=1
  • res.aspx?img=3

Now the problem is here, the page is load success with companyId = "12345", but when the images was loaded at client, it loaded the CompanyEdit.aspx again and show error with wrong id.  

I have debug and find the problem that because when image's urls were generated to client with url=res.aspx?img=1, url=res.aspx?img=3, the asp.net will understand that they are Company/Edit/res.aspx?img=1, Company/Edit/res.aspx?img=3 when it maps with URL Routing pattern.

=> So the CompanyEdit.aspx was load again with wrong id (id now is "res.aspx"). 

So, do you have any ideas to solve this problem, or other design.

Thanks, and best regard

Microsoft Office Excel cannot open or save any more documents because there is not enough available


hi all,

     i am new to asp.net programming i am trying to create an ms excel file with charts drawn in it,

i wrote the complete code for it but the it is saying

Microsoft Office Excel cannot open or save any more documents because there is not enough available memory or disk space. 

i have set the permissions to my complete disk space and all user accounts, and i tried with anti-virus disabling also it didnt work please try to help me out and my code is :

Imports System.Data.OleDb
Imports Microsoft.Office.Interop
Imports Microsoft.Office.Tools.Excel
Imports System

Merging PDF documents


I've generated some PDF documents.
But i like to merge all PDF documents to 1 PDF document, withouth saving it first.

So i would like to have 10 byes ans bound them together if possible...
But how?

Code i use right now:

////Then create new pdf file
            string strMime = null;
            string strEncoding = null;
            string strfileNameExtentions = null;
            string[] stream = null;
            Microsoft.Reporting.WebForms.Warning[] warnings = null;
            bytes = rep.Render("PDF", null, out strMime, out strEncoding, out strfileNameExtentions, out stream, out warnings);      


Custom Attributes + Reflection


I recently started messing around with custom attributes and reflection. In my code below GetCustomAttributes never return a list (it should return atleast one):

Am i defining the custom attrib wrong?

public class GOrder:IOrder
        public string CertProductIDString { get; set; }

        public string GetRESTParams()
            string data = string.Empty;
                System.Reflection.MemberInfo inf = this.GetType();
                object[] attributes;
                attributes =  inf.GetCustomAttributes(typeof(RESTParamAttrib), true);
                foreach (Object attribute in attributes)
                    RESTParamAttrib attrib = (RESTParamAttrib)attribute;
                    data = data + string.Format("\nData: {0}", attrib.Param);

            catch (Exception ex)

                throw ex;

            return data;

    public class RESTParamAttrib:System.Attribute
        public RESTParamAttrib (string param)
            Param = param;

        public string

Office Services: Merging Word Documents on the Server Side with SharePoint 2010


Office 2010 and SharePoint 2010 include a new set of components called Application Services. These put a rich set of tools in a developer's bag for Office automation. We'll show you how to use Office OpenXML, Word Automation Services and SharePoint to build a simple application that merges separate status reports into a single document.

Manvir Singh, Ankush Bhatia

MSDN Magazine July 2010

SharePoint and Open XML: Generating Documents from SharePoint Using Open XML Content Controls


This article describes how to generate documents that contain data stored in SharePoint lists. The example demonstrates how OpenXML content controls can be defined to capture list data in a Word document and how LINQ to XML can be used to query the lists. The documents are generated from a SharePoint Web Part.

Eric White

MSDN Magazine October 2009

Dynamic WPF: Create Flexible UIs With Flow Documents And Data Binding


Flow documents offer enormous flexibility in arranging text layout and pagination, but they don't support data binding, so you can't dynamically change content. Here we build a component to solve that problem.

Vincent Van Den Berghe

MSDN Magazine April 2009

Form Filler: Build Workflows to Capture Data and Create Documents


Learn how to create a workflow that uses InfoPath forms and other office documents for passing data to targeted activities and for use in Office documents.

Rick Spiewak

MSDN Magazine June 2008

WPF: Flexible Content Display With Flow Documents


Markus Egger discusses all the flexibility and power of flow documents in Windows Presentation Foundation

Markus Egger

MSDN Magazine August 2007

Toolbox: Generate Office Documents, Monitor Event Logs, and More


Most data-driven Web sites are used as interfaces to collect, process, and summarize information. Reports that summarize the data can be presented to the user in a variety of formats-the most common way is to display the report directly in a Web page.

Scott Mitchell

MSDN Magazine June 2006

Office Unbound: Bring Your Documents To Life With Data Binding In Visual Studio Tools For Office


Thanks to Visual Studio 2005 Tools for the Microsoft Office System, Windows Forms controls can be bound to databases, Web services, or objects and added to a workbook or document. Find out how.

Eric Carter and Eric Lippert

MSDN Magazine March 2006

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend