DataSource Where

  • Thread starter Thread starter etam
  • Start date Start date
E

etam

Hi,

we have the DataSource:

<asp:LinqDataSource ID="EntriesLinqDataSource" runat="server"
ContextTypeName="SubeliCMS.DataClassesDataContext"
OrderBy="Position desc, Date" TableName="Entries"
Where="SectionID == @SectionID">
<WhereParameters>
<asp:QueryStringParameter Name="SectionID"
QueryStringField="sectionid" Type="Int64" />
</WhereParameters>
</asp:LinqDataSource>

and the address:

http://localhost:60364/ShowEntries.aspx?sectionid=1

and the error:

Operator '==' incompatible with operand types 'Int64?' and 'Object'

:/

What is wrong?!

Thanks in advance,
Etam.
 
Hi etam,

The 'Where' expression wrong. Try to use "Where="SectionID == Int64(@SectionID)">
instead

Regards, Alex




e> Hi,
e>
e> we have the DataSource:
e>
e> <asp:LinqDataSource ID="EntriesLinqDataSource" runat="server"
e> ContextTypeName="SubeliCMS.DataClassesDataContext"
e> OrderBy="Position desc, Date" TableName="Entries"
e> Where="SectionID == @SectionID">
e> <WhereParameters>
e> <asp:QueryStringParameter Name="SectionID"
e> QueryStringField="sectionid" Type="Int64" />
e> </WhereParameters>
e> </asp:LinqDataSource>
e> and the address:
e>
e> http://localhost:60364/ShowEntries.aspx?sectionid=1
e>
e> and the error:
e>
e> Operator '==' incompatible with operand types 'Int64?' and 'Object'
e>
e> :/
e>
e> What is wrong?!
e>
e> Thanks in advance,
e> Etam.
 
Back
Top