当前位置: 代码迷 >> 其他数据库 >> mongodb C#获取数据报错:ReadStartDocument cannot be .该怎么处理
  详细解决方案

mongodb C#获取数据报错:ReadStartDocument cannot be .该怎么处理

热度:1369   发布时间:2013-02-26 00:00:00.0
mongodb C#获取数据报错:ReadStartDocument cannot be ...
采用 monogdb 官方驱动



public class CustomerInfo

{

private List<ContactInfo> Tx_Contact = new List<ContactInfo> ();

private List<TransactionRecordInfo> Tx_TransactionRecord = new List<TransactionRecordInfo> ();



public class ContactInfo

{

private string Tx_Name = "";//姓名

private int Tx_Sex = 0;//性别

private string Tx_Position = "";//职位

private DateTime Tx_Birthday = DateTime.Now;//生日

}

 

public class TransactionRecordInfo

{

private string Tx_ServiceType = "";//服务类型

private DateTime Tx_UpdateTime = DateTime.Now;//交易时间

private int Tx_Amount = 0;//金额

private string Tx_ServiceTime = "";//服务年限

private string Tx_Note = "";//备注

}

 

获取这样的 嵌套类型(CustomerInfo),直接用官方的驱动可以实现吗

我直接获取 为什么报错呢?ReadStartDocument cannot be called when BsonType is: Array



------解决方案--------------------------------------------------------
使用系统默认的 list,不要使用继承的list
  相关解决方案