binding profile properties in Gridview ??

Discussion in 'ASP .Net' started by =?Utf-8?B?aGlra2s=?=, Aug 8, 2005.

  1. i have an Gridview bound to a SQL server table, and I want to show user
    profile properties in a collumn, the codes are like below:
    <Columns>
    <asp:TemplateField HeaderText="Column1"
    SortExpression="Column1">
    <ItemTemplate>
    <asp:Label ID="Label1" runat="server"
    Text='<%# Eval(Profile.getProfile("ddd").toString()) %>'></asp:Label>
    </ItemTemplate>
    <EditItemTemplate>
    <asp:Label ID="Label1" runat="server"
    Text='<%# Eval("Column1") %>'></asp:Label>
    </EditItemTemplate>
    </asp:TemplateField>
    <asp:BoundField DataField="userName"
    HeaderText="userName" SortExpression="userName" />
    </Columns>

    i got the err message :'System.Data.DataRowView' does not contain a property
    with the name 'ProfileCommon'
    how can i do ??
    Regards!
     
    =?Utf-8?B?aGlra2s=?=, Aug 8, 2005
    #1
    1. Advertising

  2. =?Utf-8?B?aGlra2s=?=

    Brock Allen Guest

    Profile.getProfile("ddd") loads a Profile for the user "ddd" from the database.
    I suspect that's not what you want. Were you looking for Profile.GetPropertyValue?

    -Brock
    DevelopMentor
    http://staff.develop.com/ballen



    > i have an Gridview bound to a SQL server table, and I want to show
    > user
    > profile properties in a collumn, the codes are like below:
    > <Columns>
    > <asp:TemplateField HeaderText="Column1"
    > SortExpression="Column1">
    > <ItemTemplate>
    > <asp:Label ID="Label1"
    > runat="server"
    > Text='<%# Eval(Profile.getProfile("ddd").toString()) %>'></asp:Label>
    > </ItemTemplate>
    > <EditItemTemplate>
    > <asp:Label ID="Label1"
    > runat="server"
    > Text='<%# Eval("Column1") %>'></asp:Label>
    > </EditItemTemplate>
    > </asp:TemplateField>
    > <asp:BoundField DataField="userName"
    > HeaderText="userName" SortExpression="userName" />
    > </Columns>
    > i got the err message :'System.Data.DataRowView' does not contain a
    > property
    > with the name 'ProfileCommon'
    > how can i do ??
    > Regards!
     
    Brock Allen, Aug 8, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Giorgio
    Replies:
    0
    Views:
    3,567
    Giorgio
    Jan 9, 2006
  2. Brad
    Replies:
    1
    Views:
    1,178
    Roedy Green
    Jul 19, 2005
  3. Victor Porton
    Replies:
    1
    Views:
    721
    Steven T. Hatton
    Aug 29, 2004
  4. Andy B
    Replies:
    0
    Views:
    557
    Andy B
    May 3, 2008
  5. Steven
    Replies:
    5
    Views:
    514
    Steven
    Oct 24, 2008
Loading...

Share This Page