Carl
Thaks for reply. Now it is giving me following error, as I am connecting to Oracle
ORA-00936: missing expression
It seems we can use variable like this?
Main Topics
Browse All TopicsHello
Whenever I run my aspx page, it is giving me following error
----------------
The server tag is not well formed. at System.Web.UI.TemplatePars
at System.Web.UI.TemplatePars
at System.Web.UI.TemplatePars
at System.Web.UI.TemplatePars
------------------
It is giving me error in following selectcommand, If remove RR_COde condition, it works perfect. Please let me know whats wrong I am doing?
----------------------
<asp:SqlDataSource ID="dsGridview" runat="server" ConnectionString="<%$ ConnectionStrings:OracleCo
ProviderName="<%$ ConnectionStrings:OracleCo
SelectCommand="SELECT Rra_no,cust_code,year, month FROM trans_view where length(year)>0 and length(month)>0 and Upper(Ltrim(Rtrim(cust_Cod
FilterExpression="Convert(
<FilterParameters>
<asp:ControlParameter Name="Year" ControlID="ddlYear" PropertyName="SelectedValu
<asp:ControlParameter Name="Month" ControlID="ddlMonth" PropertyName="SelectedValu
</FilterParameters>
</asp:SqlDataSource>
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I also tried code as mentioned below, in that case it is giving different error "Cannot find column [MyVariable]. at System.Data.NameNode.Bind(
Any other suggestion?
--------------
<asp:SqlDataSource ID="dsGridview" runat="server" ConnectionString="<%$ ConnectionStrings:OracleCo
ProviderName="<%$ ConnectionStrings:OracleCo
FilterExpression="Convert(
<FilterParameters>
<asp:ControlParameter Name="Year" ControlID="ddlYear" PropertyName="SelectedValu
<asp:ControlParameter Name="Month" ControlID="ddlMonth" PropertyName="SelectedValu
<asp:ControlParameter Name="MyVariable" ControlID="lblError" PropertyName="Text" />
</FilterParameters>
</asp:SqlDataSource>
Carl
Now its workig, I made minor changes. I removed @Myvariable from select statement and
<asp:SqlDataSource ID="dsGridview" runat="server" ConnectionString="<%$ ConnectionStrings:OracleCo
ProviderName="<%$ ConnectionStrings:OracleCo
FilterExpression="Convert(
<FilterParameters>
<asp:ControlParameter Name="Year" ControlID="ddlYear" PropertyName="SelectedValu
<asp:ControlParameter Name="Month" ControlID="ddlMonth" PropertyName="SelectedValu
<asp:ControlParameter Name="MyVariable" ControlID="lblError" PropertyName="Text" />
</FilterParameters>
</asp:SqlDataSource>
Business Accounts
Answer for Membership
by: carlnorrbomPosted on 2009-10-08 at 12:57:02ID: 25529458
Hi,
nnectionSt ring %>" nnectionSt ring.Provi derName %>" SelectCommand="SELECT Rra_no,cust_code,year, month FROM trans_view where length(year) > 0 and length(month) > 0 and Upper(Ltrim(Rtrim(cust_Cod e))) = @MyVariable" Year, 'System.String') like '{0}%' and Convert(Month, 'System.String') like '{1}%'"> e" /> e" />
The error occurs because you try to use a concatenated string in the select statement. Try changing the declaration to:
<asp:SqlDataSource ID="dsGridview" runat="server" ConnectionString="<%$ ConnectionStrings:OracleCo
ProviderName="<%$ ConnectionStrings:OracleCo
FilterExpression="Convert(
<FilterParameters>
<asp:ControlParameter Name="Year" ControlID="ddlYear" PropertyName="SelectedValu
<asp:ControlParameter Name="Month" ControlID="ddlMonth" PropertyName="SelectedValu
<asp:ControlParameter Name="MyVariable" ControlID="lblError" PropertyName="Text" />
</FilterParameters>
</asp:SqlDataSource>
/Carl.