我需要绑定GridView,我使用这段代码:
ProductDBEntities db = new ProductPDBEntities(); var pro = from u in db.Products where u.PID == 1 select u; if (pro != null) { GridView1.DataSource = pro; GridView1.DataBind(); }
并得到这个错误.
System.InvalidOperationException:
Sequence contains more than one
element
有人可以告诉我,我做错了什么?