DataSource Where

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.
 
A

Alex Meleta

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top