Linq problem in GridView (related field)

Discussion in 'ASP .Net' started by Raynald, Aug 12, 2008.

  1. Raynald

    Raynald Guest

    Hi everybody,

    I have a problem on linq related field, look my simple example :

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
    Inherits="_Default" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
    <title>Untitled Page</title>
    </head>
    <body>
    <form id="form1" runat="server">
    <div>
    <asp:GridView runat="server" ID="GridView1"
    DataSourceID="LinqDataSource1" AutoGenerateColumns="false"
    AllowPaging="true">
    <Columns>
    <asp:BoundField DataField="ProductID" HeaderText="ProductID"
    ReadOnly="True" SortExpression="ProductID">
    </asp:BoundField>
    <asp:BoundField DataField="ProductName"
    HeaderText="ProductName" SortExpression="ProductName">
    </asp:BoundField>
    <asp:TemplateField HeaderText="CategoryName">
    <ItemTemplate>
    <%#Eval("Category.CategoryName")%>
    </ItemTemplate>
    </asp:TemplateField>
    </Columns>
    </asp:GridView>
    </div>
    <asp:LinqDataSource ID="LinqDataSource1" runat="server"
    ContextTypeName="NorthwindDataContext"
    TableName="Products">
    </asp:LinqDataSource>
    </form>
    </body>
    </html>


    Usually, we can expect the category name appear in our gridview but not.
    We suspect a platform or/and os configuration because on US Windows XP and
    VS 2008, it's work, but in French XP and VS not. The problem is the same on
    our production server (IIS on windows 2003 R2 in french).
    If we use Linq in C# for any query, it is ok.

    Anybody have an idea on this problem ?

    Thanks for all.
     
    Raynald, Aug 12, 2008
    #1
    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. john
    Replies:
    1
    Views:
    3,511
    Steven Cheng[MSFT]
    Jan 24, 2008
  2. George

    Linq or not Linq

    George, Nov 4, 2008, in forum: ASP .Net
    Replies:
    4
    Views:
    384
    Mike Gleason jr Couturier
    Nov 5, 2008
  3. bruce barker
    Replies:
    1
    Views:
    1,384
    bruce barker
    Nov 5, 2008
  4. Jackson420

    LINQ related query

    Jackson420, Aug 20, 2010, in forum: ASP .Net
    Replies:
    7
    Views:
    712
    Jackson420
    Aug 24, 2010
  5. Replies:
    0
    Views:
    227
Loading...

Share This Page