我有一个gridview
,我正在尝试绑定数据:
string id = Request.QueryString["uid"].ToString();
MembershipUser u = Membership.GetUser(new Guid(id));
GridView1.DataSource = Membership.GetUser(u.ProviderUserKey);
GridView1.DataBind();
我收到错误:
Data source is an invalid type. It must be either an IListSource,
IEnumerable, or IDataSource.
但我试过了:
GridView1.DataSource = Membership.GetAllUsers();
以上代码
如何将数据gridview
绑定到ProviderUserKey
,如字符串
答案 0 :(得分:0)
GridView1.DataSource = Membership.GetAllUsers();
GridView1.DataBind();
必须工作:http://msdn.microsoft.com/en-us/library/dy8swhya.aspx
检查您的语法,最后没有“ s ”字母。
Membership.GetAllUsers s ();