PC Review


Reply
Thread Tools Rate Thread

binding profile properties in Gridview ??

 
 
=?Utf-8?B?aGlra2s=?=
Guest
Posts: n/a
 
      8th Aug 2005
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!
 
Reply With Quote
 
 
 
 
Brock Allen
Guest
Posts: n/a
 
      8th Aug 2005
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!




 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Gridview binding twice Julia B Microsoft ASP .NET 4 6th Jul 2009 12:01 PM
GridView / Binding Sub Properties =?Utf-8?B?RGVtZXRyaQ==?= Microsoft ASP .NET 0 3rd Jul 2006 02:50 PM
GridView binding - how to stop initial binding Amit Microsoft ASP .NET 5 10th May 2006 01:14 PM
GridView Binding Smash Microsoft ASP .NET 1 25th Jan 2006 02:29 PM
Bind profile custom properties (from web.config) to gridview or formview Giorgio Microsoft ASP .NET 0 9th Jan 2006 07:49 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:55 AM.