table'参数不能为null。参数名称:表格 [英] table' argument cannot be null. Parameter name: table

查看:464
本文介绍了table'参数不能为null。参数名称:表格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我正在开发一个crm项目,它从crm中检索数据并向他们展示

,这里我们去吧/>


DataTable dt = RetrieveAttendeePersons();

DataSet ds = new DataSet();

ds.Tables.Add (dt);

RadGrid1.DataSource = ds;

RadGrid1.DataBind();





,错误是:table'参数不能为null。参数名称:table,它指向以下行:ds.Tables.Add(dt);



我非常感谢你的帮助。

解决方案

似乎数据表 null

验证表格,然后将其添加到数据集中。



 < span class =code-keyword> if (dt!=  null 
ds.Tables.Add(dt);


Hi ,

I am working on a crm project which retrieve data from crm and show them
, here we go

DataTable dt = RetrieveAttendeePersons();
DataSet ds = new DataSet();
ds.Tables.Add(dt);
RadGrid1.DataSource = ds;
RadGrid1.DataBind();


and the error is : table' argument cannot be null. Parameter name: table and it points to the following line : ds.Tables.Add(dt);

I would really appreciate your help .

解决方案

It Seems the datatable is null,
validate the table before adding it to a dataset.

if(dt!= null)
       ds.Tables.Add(dt);


这篇关于table'参数不能为null。参数名称:表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆