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

后端 未结 7 2294
面向向阳花
面向向阳花 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 07:06

    always bind dataset with table index to gridview...

    ex. gridgrdCommunication.Table[0]; as metioned above by Tsilb

    second way you intentionally write..

    gridgrdCommunication.DataSourceID = String.Empty; gridgrdCommunication.DataSource=ds; gridgrdCommunication.DataBind();

    0 讨论(0)
提交回复
热议问题