3.1 Database
The following example is a UDC file that retrieves data from a database. When there are child elements in the ConnectionInfo element that are not database-related, the protocol server will only use the database-related elements.
-
<?xml version="1.0" encoding="UTF-8"?> <?MicrosoftWindowsSharePointServices ContentTypeID="0x010100B4CBD48E029A4AD8B62CB0E41868F2B0"?> <udc:DataSource MajorVersion="2" MinorVersion="0" xmlns:udc="http://schemas.microsoft.com/office/infopath/2006/udc"> <udc:Name>DB Connection</udc:Name> <udc:Description>Database</udc:Description> <udc:Type MajorVersion="2" MinorVersion="0" Type="Database"> <udc:SubType MajorVersion="0" MinorVersion="0"></udc:SubType> </udc:Type> <udc:ConnectionInfo Purpose="ReadOnly" AltDataSource=""> <udc:WsdlUrl>http://</udc:WsdlUrl> <udc:SelectCommand Type=""> <udc:ListId></udc:ListId> <udc:WebUrl>http://</udc:WebUrl> <udc:ConnectionString>Provider=SQLOLEDB.1;Password=MyPassword;Persist Security Info=True;User ID=MyUserName;Initial Catalog=AdventureWorks;Data Source=testmachine;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=MYWORKMACHINE;Use Encryption for Data=False;Tag with column collation when possible=False</udc:ConnectionString> <udc:OperationName></udc:OperationName> <udc:ServiceUrl>http://</udc:ServiceUrl> <udc:SoapAction></udc:SoapAction> <udc:Query>select "DocumentID","Title","FileName","FileExtension","Revision","ChangeNumber","Status","DocumentSummary","Document","ModifiedDate" from "Production"."Document" as "Document"</udc:Query> </udc:SelectCommand> <udc:UpdateCommand> <udc:OperationName></udc:OperationName> <udc:ServiceUrl>http://</udc:ServiceUrl> <udc:SoapAction></udc:SoapAction> <udc:Submit></udc:Submit> </udc:UpdateCommand> </udc:ConnectionInfo> </udc:DataSource>