Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试使用以下代码清除网格视图,但它不起作用:
da.Fill(dt); GridView1.DataSource = dt; GridView1.DataBind(); DataSourceOperation.Delete=GridView1; connection.Close();`
请告诉我这个声明有什么问题。
尝试:
GridView1.DataSource = null;
DataSourceOperation是一个枚举,因此您不能将 Enumeration 设置为GridView. 这甚至如何编译?
DataSourceOperation
GridView
试试这个怎么样:
dt.Rows.Clear(); GridView1.DataBind();