Jialiang
Tue Jun 10 04:49:02 CDT 2008
Hello Chunk
This is a frequently asked question. The error ¡°A call to Bind was not well
formatted. Please refer to documentation for the correct parameters to
Bind¡± is listed by the compiler because it can only be bound to the
first-level properties of a class object. In your code snippet,
Bind("ApplicationRoles.Application.ApplicationName") has three levels, thus,
the error appears. My colleague, Linda, once wrote a blog for the issue:
http://blogs.msdn.com/msdnts/archive/2007/01/19/how-to-bind-a-datagridview-column-to-a-second-level-property-of-a-data-source.aspx.
It shows a workaround to bind to the second, third, or any other level of
sub properties. Another possible workaround is to move the third level
property to the first level by using creating a DB view.
Please let me know if you have any other concerns, or need anything else.
Regards,
Jialiang Ge (jialge@online.microsoft.com, remove ¡®online.¡¯)
Microsoft Online Community Support
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notifications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
"Chuck P" <Chuck@newsgroup.nospam> wrote in message
news:2D48D2C9-113D-48CB-ACC5-D50D5C8A5340@microsoft.com...
>I can run the following query in LinqPad
>
> from u in UsersInRoles
> select new {u.ApplicationID,
> u.ApplicationRoles.Application.ApplicationName}
>
> However,
> <asp:LinqDataSource ID="LinqDataSource1" runat="server"
> ContextTypeName="ApplicationManagment.ApplicationsDataContext"
> TableName="UsersInRoles" StoreOriginalValuesInViewState="False">
> </asp:LinqDataSource>
>
> <asp:Label ID="lblApplicationName" runat="server" Text='<%#
> Bind("ApplicationRoles.Application.ApplicationName") %>'></asp:Label>
>
> Parser Error Message: A call to Bind was not well formatted. Please refer
> to documentation for the correct parameters to Bind.
>
>
> Is the double link not allowed or wrong syntax in a GridView?
> The Primary Key on ApplicationRoles is on ApplicationID, RoleID (FK to
> UsersInRoles)
>
>
> The tables are Applications (description of application; PK ApplicationID)
> ApplicationRoles (the roles allowed in an
> application )
> UsersInRoles (users in a role for an application)