Click here to Skip to main content
15,749,281 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
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 .
Posted
Comments
george4986 11-Mar-14 5:52am    
value of dt is null?

1 solution

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

C#
if(dt!= null)
       ds.Tables.Add(dt);
 
Share this answer
 
Comments
Member 10660531 11-Mar-14 6:00am    
I add it and now it gives me this error "The IListSource does not contain any data sources." and it points to the following line " RadGrid1.DataBind();"
Karthik_Mahalingam 11-Mar-14 6:09am    
RadGrid1.DataSource = ds.Tables[0];
do like this

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900