日期:2014-05-17  浏览次数:20455 次

出现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" 
 &nb