前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >about store RecordField submit emptystring issue

about store RecordField submit emptystring issue

作者头像
阿新
发布2018-04-12 16:07:56
6650
发布2018-04-12 16:07:56
举报
文章被收录于专栏:c#开发者c#开发者

operate screenshot

When click save button submit to change,trace store beforeStoreChanged eventHandler data no problem.

But when store beforerecordInserted event handler new values changed empty string, when AfterInserted throw exception;

代码语言:javascript
复制


Now I solve the problem changed Source Code file Store.cs

private void MakeInsertes(IDataSource ds, XmlDocument xml)
{
XmlNodeList insertingRecords = xml.SelectNodes("records/Created/record");
string id = GetIdColumnName();
foreach (XmlNode node in insertingRecords)
{
record = node;
values = new SortedList(this.Reader.Reader.Fields.Count);
keys = new SortedList();
oldValues = new SortedList();
foreach (RecordField field in this.Reader.Reader.Fields)
{
//modify by neo date:2011/6/9 emptystring convert to null
XmlNode keyNode = node.SelectSingleNode(field.Name);
if (String.IsNullOrEmpty(keyNode.InnerText))
values[field.Name] = null;
else

values[field.Name] = keyNode != null ? keyNode.InnerText : null;

}

I don't know that there are no other better solutions,So I hope to have your support

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2011-06-14 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
数据库
云数据库为企业提供了完善的关系型数据库、非关系型数据库、分析型数据库和数据库生态工具。您可以通过产品选择和组合搭建,轻松实现高可靠、高可用性、高性能等数据库需求。云数据库服务也可大幅减少您的运维工作量,更专注于业务发展,让企业一站式享受数据上云及分布式架构的技术红利!
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档