当前位置: 代码迷 >> ASP.NET >> 出现Operator '==' incompatible with operand types 'Int32' and 'Object'该怎么处理
  详细解决方案

出现Operator '==' incompatible with operand types 'Int32' and 'Object'该怎么处理

热度:10888   发布时间:2013-02-25 00:00:00.0
出现Operator '==' incompatible with operand types 'Int32' and 'Object'
<asp:GridView ID="GridView5" runat="server" AutoGenerateColumns="False" 
            DataKeyNames="CategoryId" DataSourceID="LinqDataSource1"  >
            <Columns>
                <asp:CommandField ShowSelectButton="True" />
                <asp:BoundField DataField="CategoryId" HeaderText="CategoryId" 
                    InsertVisible="False" ReadOnly="True" SortExpression="CategoryId" />
                <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
                <asp:BoundField DataField="Descn" HeaderText="Descn" SortExpression="Descn" />
            </Columns>
        </asp:GridView>
        <asp:LinqDataSource ID="LinqDataSource1" runat="server" 
            ContextTypeName="DatabaeseDataContext" EntityTypeName="" TableName="Categories">
        </asp:LinqDataSource>
        <asp:DetailsView ID="DetailsView2" runat="server" AutoGenerateRows="False" 
            DataKeyNames="CategoryId" DataSourceID="LinqDataSource8" Height="50px" 
            Width="202px">
            <Fields>
                <asp:BoundField DataField="CategoryId" HeaderText="CategoryId" 
                    InsertVisible="False" ReadOnly="True" SortExpression="CategoryId" />
                <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
                <asp:BoundField DataField="Descn" HeaderText="Descn" SortExpression="Descn" />
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" 
                    ShowInsertButton="True" />
            </Fields>
        </asp:DetailsView>
                <asp:LinqDataSource ID="LinqDataSource8" runat="server" 
            ContextTypeName="DatabaeseDataContext" EnableDelete="True" EnableInsert="True" 
  相关解决方案