码迷,mamicode.com
首页 > 其他好文 > 详细

架构验证过程发现非数据类型错误 validation found non-data type errors

时间:2016-04-18 18:50:26      阅读:209      评论:0      收藏:0      [点我收藏+]

标签:

问题:

infopath报一下错误

validation found non-data type errors

架构验证过程发现非数据类型错误

原因:

重复表字段在后台代码里要一一对应,否则报错。

技术分享

错误代码:

//Remove 1st row.  It‘s empty by default
                XPathNavigator FirstRowNode = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:e301/my:e301list/my:e301item[1]", NamespaceManager);
                FirstRowNode.DeleteSelf();

                XPathNavigator e301list = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:e301/my:e301list", NamespaceManager);
                string myNamespace = NamespaceManager.LookupNamespace("my");
                using (XmlWriter writer = e301list.AppendChild())
                {
                    writer.WriteStartElement("e301item", myNamespace);
                    writer.WriteElementString("SAPNo", myNamespace, Excel_SAP_NO);
                    writer.WriteElementString("cost", myNamespace, Excel_Cost.ToString());
                    writer.WriteElementString("Description", myNamespace, Excel_Description);
                    writer.WriteElementString("Quantity", myNamespace, Excel_Quantity);
                    writer.WriteElementString("RequiredDate", myNamespace, Excel_Required_date.Year + "-" + Excel_Required_date.Month + "-" + Excel_Required_date.Day);
                    writer.WriteElementString("StorageLocation", myNamespace, Excel_Storage_location);
                    writer.WriteElementString("Remark", myNamespace, Excel_Remark);
                    writer.WriteEndElement();
                    writer.Close();
                }

  

 

架构验证过程发现非数据类型错误 validation found non-data type errors

标签:

原文地址:http://www.cnblogs.com/jindahao/p/5405363.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!