??? ????? ????? InfoPath ?? ???? ??? ?????? ADO.NET DataSet (System.Data.DataSet) ? ?? ????? ????? ????? ??????? ?? InfoPath:
????? ??? ?????? XML ??? ??????? ???? XML ??? ????? ???.
????? ??? InfoPath ??????? ????? DataSet ADO.NET ??????. ???? InfoPath ?? ?????? XML ???. ??? ????? ????? ADO.NET DataSet ???? ??? ??????? ?????? ????? ??? ?????? XML ???? ???? ????? DataSet ADO.NET ?? ????? ?????? ???????? InfoPath.
- ??? ?? ??? "??? ??? ???? ???" ???? ???? ?????? ???????? ???????? ???? ??? ????? ??? DataSet ?????? ???? ?????? < xsd: ?? / >. ???? ????????? InfoPath ?????? ????? XML ???? ?? ??????? ?????? ???? ???. ??? ???? ??? ?? ???? InfoPath ?????? ???? ??????? ???? ???? ??? ???.
- ????? ADO.NET DataSet ??? ???? ???? ???? ??? ???????? ???? ?? ??????? ???. ?? ????? ??? ??????? ?? InfoPath ?????? ?????.
- ??? ?????? ???????? ???????? ?? ADO.NET DataSet ?? ???? XML <diffgr:diffgram> ?????? ?? ???? ????. ?? ???? ??? ????? XML ???? ????? ??? ?????? ADO.NET DataSet ??????? ???????? ???? ?? ?? ????? ?? ??????. ??? ???????? ?? ?????? ?? ?????? ? ?? ???? ?????? ?? ???????? ?? ????? InfoPath.
- ?? ????? InfoPath ??? ??? ???? ?????? ???? ???? ???? ADO.NET DataSet. ??? ???? ??????? ADO.NET DataSet ????? ?????? ???? ???? ?????? ???? ?? ??????? ??????? ?? ????? ??? ?? ?? ????????? ???????. (??? ?? ????? ?? ???? diffgram ?????? "diffgr" ?? ??? XML.) ???? ???? InfoPath ?? ??? .NET Framework ?? ??????? ???? DataSet ?????? ?????? XML ?? re-implement ???????. ????? ?? ?? ??? ???????? ?? ??? ??????? ?? InfoPath.
??? ?? ??? ??????? ?? Microsoft Office InfoPath 2003 Service Pack 1 (SP1). ??? ??? ???????? ??? ?????? ??? ???? ???? ???? ?? Microsoft Office 2003. InfoPath 2003 ?????? ????? ?????? SP1 ???? ???? ???? datasets ????? ????? ?? ????? ????? ?? ???? ??? ???? ?????? ADO.NET DataSet ?? InfoPath 2003.
?????? ??? ??????? ??????? ???? ??? ??? ??????? ?????? ?????? ?? "????? ??????? ?? Microsoft:
870924
(http://support.microsoft.com/kb/870924/
)
????? ?????? ??? ???? ???? ???? ?? Office 2003
??????? ?????? ??? ??? ??????? ?? ?????? ????? ???? ??? ????? ???? ADO.NET DataSet ???? ?? ??????? ?? ????? ???? ??? ??????. ????? ???? ???? ????? diffgram ???????. ????? XML ??????? ??? InfoPath. ???? ??? "???? ?? ?????????" ?????? ??? ??????? ???????? ????? ?? ??? ????.
????? ??? ?????? ??? ???????.
????? ????? ????? ??????
- ?? Microsoft Visual Studio .NET ? ????? ????? ???? ???? Microsoft C# ASP.NET ??? ???. ????? ??? ??? ??????? ??? NorthwindDataSet.
???? ?????? ???? ?? ???? ????? ?????? ??? http://localhost/NorthwindDataSet. - ?? ??????? ??????? ???? ??? ????? ???? ???. ??? ???? ??? ??????? CustomerInfo.asmx.
- ????? ????????? ???????? ??????? ??? ???? ??? CustomerInfo.asmx ???????:
/************************************************************************
* GetCustomerInfo -- This method retrieves information from the
* Customer table of the Northwind database and then returns it in an
* ADO.NET DataSet.
* Parameters: CustomerID is the string that contains the CustomerID of the
* customer to retrieve the information for.
* Returns: An ADO.NET DataSet that contains information about the customer.
* *********************************************************************/
[WebMethod]
public System.Data.DataSet GetCustomerInfo( string CustomerID )
{
try
{
//Create a Microsoft SQL Server connection to the local SQL Server.
System.Data.SqlClient.SqlConnection theConnection = new SqlConnection();
theConnection.ConnectionString = "Data Source=(local);" +
"Integrated Security=SSPI;Initial Catalog=northwind";
//Create an SQL Command to query the data.
System.Data.SqlClient.SqlCommand theCommand = new SqlCommand();
theCommand.Connection = theConnection;
theCommand.CommandText = "SELECT \"CustomerID\",\"CompanyName\"," +
"\"ContactName\",\"ContactTitle\",\"Address\",\"City\",\"Region\"," +
"\"PostalCode\",\"Country\",\"Phone\",\"Fax\" FROM \"Customers\" " +
"WHERE CustomerID='" + CustomerID + "'";
//Create an SQL DataAdapter to read the data.
System.Data.SqlClient.SqlDataAdapter theDataAdapter = new SqlDataAdapter();
theDataAdapter.SelectCommand = theCommand;
//Open the command, and then read the data.
theConnection.Open();
System.Data.DataSet theCustomerInfo = new DataSet();
theCustomerInfo.DataSetName = "CustomerInfo";
theCustomerInfo.Namespace = "http://localhost/NorthwindDataSet/CustomerInfo";
theDataAdapter.Fill( theCustomerInfo, "Customers" );
//Clean up.
theConnection.Close();
//Return the result.
return theCustomerInfo;
}
catch(Exception ex)
{
return null;
}
}
???????? ???????? ????? ????? ??????? ????? ??????? ???? Microsoft SQL Server ??? ??? ????????? ??? ???? ???. ????? ?? ???? ????? ????? ????? ??????? ????????? ?? ??? ?????? System.Data.SqlConnection ??????? ????? ??????? ??? ???? ?????? SQL Server. ?? ????? ??? ????? ?????? SQL Server ?????? ???? ??? ?????? ??? ????? ????????.?????? ??? ??????? ??????? ???? ??? ??? ??????? ?????? ?????? ?? "????? ??????? ?? Microsoft: 815154
(http://support.microsoft.com/kb/815154/
)
HOW TO: ????? ???? ?????? SQL ????????? .NET
- ?? ???? ?????? CustomerInfo.asmx.cs ?????? ???????? ???????? ??????? ??? ?????? USING:
using System.Data.SqlClient;
- ????? ??????? NorthwindDataSet.
- ??? ????? InfoPath. ?? ??????? ???? ???? ??? ????? ?????.
- ?? ??? ???? ????? ???????, ???? ??? ???? ?? "???? ????????".
- ?? ???? ?????? "????? ????? ???? ????????" ? ??? ??? ???? ???????? ???? ??? ?? ???? ??? ??????.
- ??? ?????? ?????? ?? ???? ??? ??????.
- ???? ????? URL ??? ???? ??? CustomerInfo (??? ???? ??????? http://localhost/NorthwindDataSet/CustomerInfo.asmx) ?? ???? ??? ??????.
- ????? ????? GetCustomerInfo ??????? ?? ???? ??? ??????.
- ??? ????? s0:CustomerID ?? ???? ??? ????? ???? ????.... ?? ???? ?????? ????? ?????? ? ???? ALFKI ??? ?? ???? ??? ?????.
- ???? ??? ??????.
?????? ???? InfoPath ???? ????? ????? ?? ??? "?????? ?????".
?? ??? ????????
?????? ?? ???? ??????? ????? ??????? ??????? ???? ?????? ??????? ??????? ?????? ????? ???? ??? ????? ????? ??????? ??? ?????? ?? XML ADO.NET DataSet. ????? ?????? ???? ???? ???? ??????? ?????? XML ?? ??? InfoPath. ????? ???? ??? ???? ????? ??????? ?????? ?????? ?? ?????? XML ?? ????? ???? ??? ???? ????? ????? ?????? XML ?? ??? ????? ????? ???? ??????? ????.
????? ?? ????? ????? ?????.
???? ?????? 1
????? ???? ???? ???? XML ??? ??????
??? ????? ???? ??? ???? ???? ????? ??????. ???????? ??? ???? ??? ???? ?????? XML ???? ???? ?????? ???? ??? ?????? ??? ??? ??? ???? ?????? ????? ??? ??????? ??? ????? ?? ???????? ???????.
??? ????? ?? ???? ????? ??? ???? ?????? ????? ????. ?? ???? ??? ???? ?????? ???? ?????? XML. ????, ??? ?? ???? InfoPath ????????? ?????? ?? ????? ????????. ??? ?? ??? ????? ????? ???????? ???? ??????? ???????? ??????? ???? ????? ???? ??? ?????? ?????? infers InfoPath ?? ????? ??? ??? ???????. ??? ??? ?????? ??????? ???? ?????? ??????? ?? ?????? ??? ?????? ?? ??????? ????? InfoPath ???? ???.
?????? ???? ?????? 1 ???? ??????? ???????:
- ?? Visual Studio .NET ? ???? ??????? NorthwindDataSet.
- ?? ??????? ??????? ???? ??? ????? ???? ???. ??? ???? ??? ??????? IPCustomerInfo.asmx.
- ?? ?????? ????????? ???????? ??????? ??? ???? ??? IPCustomerInfo.asmx ???????:
/************************************************************************
* GetCustomerInfoNoSchema: This method calls the GetCustomerInfo
* method of the CustomerInfo.asmx Web service, and then strips the
* inline schema from the resulting DataSet.
* Parameters: CustomerID is the string that contains the CustomerID of the
* customer to retrieve information for.
* Returns: An XML Document with no inline schema.
* *********************************************************************/
[WebMethod]
public System.Xml.XmlDocument GetCustomerInfoNoSchema( string CustomerID )
{
//Get the core data.
CustomerInfo theCustomerInfoService = new CustomerInfo();
System.Data.DataSet theDataSet =
theCustomerInfoService.GetCustomerInfo( CustomerID );
//Create a new XmlDocument from the data of the dataset.
System.Xml.XmlDocument theDocument = new System.Xml.XmlDocument();
theDocument.LoadXml( theDataSet.GetXml() );
//Return the result.
return theDocument;
}
???????? ???????? ????? ?????? ???? ??? ?????? ???? ADO.NET DataSet ??? ?? ???? ?????? ????? XML ???? ???? ??????? ?????? ??????. - ????? ??????? NorthwindDataSet.
- ??? ????? InfoPath. ?? ??????? ???? ???? ??? ????? ?????.
- ?? ??? ???? ????? ???????, ???? ??? ???? ?? "???? ????????".
- ?? ???? ?????? "????? ????? ???? ????????" ? ??? ??? ???? ???????? ???? ??? ?? ???? ??? ??????.
- ??? ?????? ?????? ?? ???? ??? ??????.
- ???? ????? URL ??? ???? ??? IPCustomerInfo (??? ???? ??????? http://localhost/NorthwindDataSet/IPCustomerInfo.asmx) ?? ???? ??? ??????.
- ????? ????? GetCustomerInfoNoSchema ??????? ?? ???? ??? ??????.
- ??? ????? s0:CustomerID ?? ???? ??? ????? ???? ????. ?? ???? ?????? ????? ?????? ? ???? ALFKI ??? ?? ???? ??? ?????.
- ???? ??? ?????? ?? ???? ??? ?????.
- ??? ??? ???? ?????? ?? ?????? queryFields ?? ??? ?????? "???? ????????" ?? ?? ?????? ????? "???? ??????" ??? ????? ??? ?????????.
- ??? ???????? ??????? ?? ?????? dataFields ?? ??? ?????? "???? ????????" ?? ?? ?????? ???????? ??????? ??? ????? ????? "????? ????????. ???? ??? ???? ?? ????? ????.
- ?????? ??????? ?? ???????. ???? ?? ??? ???? ?????? ??? ?????? ????????? ????? ????? ??? ?? ????? ????? ???????? ??? ???? ????? ???? ?? ???? ???? ???.
???? ?????? 2
????? ??? ?????? ????? ???? ????? ????? ?????? XML ?? ADO.NET DataSet
??? ???? ???? ?? ????? ????? ?? ?????? ???????. ???????? ??? ???? ??? ?? ???? ????? ??? ???? ??? ?? ????? ???? ??? ???? ??? ????????? ?? ? ???? ??? ??? ????? ????? ???? ??? ???? ???????? ???? ???? ??????. ??? ????? ?? ???? ??? ???? ?????? ??? ???? ?????? XML ???? ???? ??????. ?????? ??? InfoPath ?? ???? ????????? ???? ????????. ????? ????? ????? InfoPath ???? ?? ??????? ?? ??? ???? ?????? ??? ???? ??????? ???? ???? ?? ??? ??????? ?????????? ???????.
- ?? Microsoft Internet Explorer? ????? ??? ???? ???? ????????? (URL) ????? ?????? ???? ??? CustomerInfo (??? ???? ??????? http://localhost/NorthwindDataSet/CustomerInfo.asmx).
- ???? ??? GetCustomerInfo ???????? ??? ???? ?????? ??? ???????.
- ?? ???? ???? "???? ??????" ? ???? ALFKI ?? ???? ??? ???????.
- ?? XML ???? ??? ?? <xs:schema> ???? ? ???? ?? ??????? ? ??? ?? ????? ??? ??? ?? ???? ??????? ?? "???????".
- ????? ?????? - ?? ???? ???? ?? ???? ?? ?? ???? ??????? ?? CustomerInfo.xsd.
- ???? ???? ????? Visual Studio .NET ?? ???????? ??? ?????? ???? ??? ???? CustomerInfo.xsd.
- ?????? ????? ?????? ?????? ??? ????? ?? ??? ??????:
xsd.exe CustomerInfo.xsd /c /l:cs
- ?? Visual Studio .NET ? ???? ??????? NorthwindDataSet.
- ?? ??????? ??????? ???? ??? ????? ???? ?????.
- ???????? ??? ??? CustomerInfo.cs ???? ??? ??????? ???????? ?????? Xsd.exe ?? ???? ??? ???.
- ????? ????? ????? CustomerInfoWrapper ??? ??? CustomerInfo ??? CustomerInfoCustomers.
- ?? ?????? ????????? ???????? ??????? ??? ???? ??? IPCustomerInfo.asmx:
/************************************************************************
* GetCustomerInfoWrapper: This method calls the GetCustomerInfo
* method of the CustomerInfo.asmx Web service, and then strips the
* inline schema from the resulting DataSet.
* Parameters: CustomerID is the string that contains the CustomerID of the
* customer to retrieve information for.
* exampleData is the wrapper class to fill with the data from the
* ADO.NET DataSet.
* Returns: none
* *********************************************************************/
[WebMethod]
public void GetCustomerInfoWrapper( string CustomerID,
out CustomerInfoWrapper.CustomerInfo exampleData )
{
//Get the core data.
CustomerInfo theCustomerInfoService = new CustomerInfo();
System.Data.DataSet theDataSet =
theCustomerInfoService.GetCustomerInfo( CustomerID );
theDataSet.Namespace = "http://localhost/NorthwindDataSet/CustomerInfo";
//Create an in-memory stream to write the DataSet to.
System.IO.MemoryStream theStream = new System.IO.MemoryStream();
//Write the DataSet to the stream.
theDataSet.WriteXml( theStream, XmlWriteMode.IgnoreSchema );
//Move the streams seek pointer back to the beginning, or
//deserialization will fail.
theStream.Seek(0, System.IO.SeekOrigin.Begin );
//Create an XML Serializer to read the DataSet.
System.Xml.Serialization.XmlSerializer ser = new
System.Xml.Serialization.XmlSerializer(
typeof(CustomerInfoWrapper.CustomerInfo));
//Deserialize a CustomerInfo wrapper from the stream.
exampleData = ((CustomerInfoWrapper.CustomerInfo)
(ser.Deserialize( theStream )));
return;
}
???????? ???????? ????? ?????? ???? ??? ?????? ???? ADO.NET DataSet ??? ?? ???? ?????? ????? XML ???? ???? ??????? ?????? ??????. - ????? ??????? NorthwindDataSet.
- ??? ????? InfoPath. ?? ??????? ???? ???? ??? ????? ?????.
- ?? ??? ???? ????? ???????, ???? ??? ???? ?? ???? ????????...
- ?? ???? ?????? "????? ????? ???? ????????" ? ??? ??? ???? ???????? ???? ??? ?? ???? ??? ??????.
- ??? ?????? ?????? ?? ???? ??? ??????.
- ???? ????? URL ??? ???? ??? IPCustomerInfo (??? ???? ??????? http://localhost/NorthwindDataSet/IPCustomerInfo.asmx) ?? ???? ??? ??????.
- ?? ????? ????? ????? GetCustomerInfoWrapper ?? ???? ??? ??????.
???? ?? InfoPath ?? ????? ????? ????? ??????? ????? ???? ???. - ???? ??? ?????.
- ??? ??? ???? ?????? ?? ?????? queryFields ?? ??? ?????? "???? ????????" ?? ?? ?????? ????? "???? ??????" ??? ????? ??? ?????????.
- ??? ???????? ??????? ?? ?????? dataFields ?? ??? ?????? "???? ????????" ?? ?? ?????? ???????? ??????? ??? ????? ????? "????? ????????.
- ?????? ??????? ??????? ??.
???? ?? ???? ?? ????? ?????? ???? ?? ??? ???????.
???? ???????: 822020 - ????? ??? ??????: 03/???/1427 - ??????: 2.4
????? ???
- Microsoft Office InfoPath 2003
| kbmt kbtshoot kbxml kbprb KB822020 KbMtar |
????? ???????: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????
822020
(http://support.microsoft.com/kb/822020/en-us/
)