“Both DataSource and DataSourceID are defined” error using ASP.NET GridView

后端 未结 7 2347
面向向阳花
面向向阳花 2021-02-15 06:38

\"Both DataSource and DataSourceID are defined on \'grdCommunication\'. Remove one definition.\"

I just got this error today, the code has been working until this after

7条回答
  •  被撕碎了的回忆
    2021-02-15 06:46

    Try this:

    DataSet dsActivity = objCompany.GetActivityDetails();
    grdCommunication.DataSource = dsActivity.Tables[0];
    grdCommunication.DataBind();
    

提交回复
热议问题