Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

Numeric parameter in filterexpression at filter parameter not work

$
0
0

Hello All

Im new in asp, looks simple but can not solve it after many dais.  I appreciate for any help.

I have two sqldatasource and two gridview connected to each of datasources, in which the second filtered by the key from first gridview. The key is numeric. When i use like {0},...

FilterExpression="ClKey={0}"

I get this error

Syntax error: Missing operand after '00' operator.

.... 

when i use

FilterExpression="ClKey='{0}'"

i get this error

Cannot perform '=' operation on System.Decimal and System.String.

-----------------------

when i use 

FilterExpression="ClKey=#{0}#"

got this error

Cannot perform '=' operation on System.Decimal and System.DateTime.

------------------

when i use

FilterExpression="ClKey=%{0}%"

get this error

Syntax error: Missing operand before 'Mod' operator.

-------------

when i use

FilterExpression="ClKey LIKE '{0}'"

get this error

Cannot perform 'Like' operation on System.Decimal and System.String.

---------

the full datawource is defined as follow

<asp:SqlDataSource ID="sqlds_ViewRegist_HourBase" runat="server" 
                            ConnectionString="<%$ ConnectionStrings:shabdizdbConnectionString %>" 
                            SelectCommand="SELECT [RegNum], [reg_index], [StCode], [ClKey], [InstCode], [InstName], [ClassDateSerial], [Dates], [ClassHourSerial], [TimeFrom], [TimeTo], [ClassName], [TeachFnLn], [StFnLn], [RegDHserial], [AttendTitle], 
                            [TchCode] FROM [viewRegist_TimeBase] WHERE (Dates &lt;= GETDATE() + @dt2) AND (Dates &gt;= GETDATE() - @dt1)  ORDER BY TimeFrom"
                            FilterExpression="ClKey LIKE '{0}'" ><FilterParameters><asp:ControlParameter ControlID="clndClassDates" 
                                    DefaultValue="DateValue(now())" Name="Dates" PropertyName="SelectedDate" /><asp:ControlParameter ControlID="grv_Classes" DefaultValue="" Name="ClKey" 
                                        PropertyName="SelectedValue" /></FilterParameters><SelectParameters><asp:ControlParameter ControlID="txtb_Before" Name="dt1" PropertyName="Text" 
                                    Type="Int32" /><asp:ControlParameter ControlID="txtb_After" Name="dt2" PropertyName="Text" 
                                    Type="Int32" /></SelectParameters>

Thank you for any help


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>