问题,在使用Newtonsoft.Json对强类型的DataTable进行系列化时会出现循环引用错误

解决办法,不要直接系列化强类型的DataTable,改为

JsonConvert.SerializeObject(dt.DefaultView.ToTable());
系列化缺省视图转换出来的DataTable
												

Newtonsoft.Json转换强类型DataTable错误:Self referencing loop detected with type ......的更多相关文章

  1. c# json 序列化时遇到错误 error Self referencing loop detected for type

    参考网址:http://blog.csdn.net/adenfeng/article/details/41622255 在写redis缓存帮助类的时候遇到的这个问题,本来打算先序列化一个实体为json ...

  2. Self referencing loop detected with type

    json.net namespace EFDAL{    using System;    using System.Collections.Generic;    using Newtonsoft. ...

  3. .NET JSON 转换 Error ” Self referencing loop detected for type“

    在进行实体转换为Json格式报错如下图: Self referencing loop detected for property 'md_agent' with type 'System.Data.E ...

  4. JSON.NET的Self referencing loop detected with type的原因以及解决办法

    模型中有循环引用是很常见的.例如,以下模型显示双向导航属性: : public class Category : { : public Category() : { : Products = new ...

  5. EF关于报错Self referencing loop detected with type的原因以及解决办法

    1)具体报错 { "Message": "出现错误.", "ExceptionMessage": "“ObjectContent` ...

  6. Self referencing loop detected for property 错误

    EF 序列化返回json时 报错:Self referencing loop detected for property 解决方案:在webapiconfig.cs文件中,增加设置: 1.config ...

  7. codefirst mvc Self referencing loop detected for property

    登录时,json序列化用户类时提示错误"Self referencing loop detected for property--",经过5个小时的查找,发现原因可能是,用户类包含 ...

  8. Request failed with status code 500以及自引用循环Self referencing loop detected for property ‘xx‘ with type

    错误Error: Request failed with status code 500 ,调试前端没问题,后端也没问题,还报错"连接超时" 在Network中找到错误Self r ...

  9. Newtonsoft.Json 转换DateTime类型为字符串时,串内部会有一个T。解决方案

    使用Newtonsoft.Json 转换DateTime类型时,若使用标准转换,则字符串内会有一个T(虽然再转换成DateTime没有问题). 若要转换成DateTime没有T,可以加上特性: pub ...

随机推荐

  1. ionic andorid apk 签名, 查看签名MD5

    ionic cordova build android生成的是带签名的android-debug.apk, 这个是可以在手机上安装的, 但是换个电脑打包这个签名就不一样了, 这样就不能直接替换安装了, ...

  2. 每天一个linux命令:du

    1.命令简介 du (Disk usage) 用来计算每个文件的磁盘用量,目录则取总用量. 2.用法 用法:du [选项]... [文件]... 或:du [选项]... --files0-from= ...

  3. 【nginx&php】后台权限认证方式

    一.最常用的方法(代码中限制) 1.如何限制IP function get_new_ip(){ if(getenv('HTTP_CLIENT_IP')) { $onlineip = getenv('H ...

  4. phpexcel 导入超过26列、处理时间格式

    见地址:http://www.thinkphp.cn/topic/33376.html excel处理时间: https://blog.csdn.net/xqd890608/article/detai ...

  5. OpenCV 对矩阵进行掩码操作

    Mask operations on matrices https://docs.opencv.org/master/d7/d37/tutorial_mat_mask_operations.html ...

  6. Python之数学题目练习

    首先,下面的题目来自我的大学同学的分享,他用数学证明,我用编程计算机发现了答案. 他的数学推理: 然后下面是我的Python代码: #coding=utf-8 # 井的高度 well_hegith = ...

  7. MySQL 4 种隔离级别的区别

    ## 测试环境 mysql> select version(); +------------+ | version() | +------------+ -log | +------------ ...

  8. Sublime Text3 运行 PHP 文件

    在 Zend Studio(12.5)下可以通过 Run(Ctrl + F11)把 PHP 程序的执行结果通过 Debug Output 显示在 IDE 中,这样比开启 Server,再打开浏览器执行 ...

  9. Gin框架使用详解

    1.什么是Gin Gin是go编写的一个web应用框架. 2.Gin安装 go get github.com/gin-gonic/gin 3.Gin使用示例 package main import ( ...

  10. 【LeetCode】二叉搜索树的前序,中序,后续遍历非递归方法

    前序遍历 public List<Integer> preorderTraversal(TreeNode root) { ArrayList<Integer> list = n ...