如何在SQLDataSource中使用绑定表达式 [英] how to use Binding Expression in SQLDataSource

查看:61
本文介绍了如何在SQLDataSource中使用绑定表达式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
希望您能找到解决我问题的方法
我想在SQL SelectCommand中使用绑定表达式

Hey All ,
I wish you could find solution for my problem
i want to use binding expression in SQL SelectCommand

<asp:SqlDataSource ID="SqlDataSource3" runat="server"

                        ConnectionString="<%$ ConnectionStrings:OpticsConnectionString %>"

                        SelectCommand="SELECT [pro_name], [pro_purchased_qty], [pro_sale_price], [Purchases_price]
                        FROM
                        [rpt_UVU_allOrders_In_Details_R]
                        WHERE
                        [order_id]"+'<%#"="+Eval("order_id") %>'>
                    </asp:SqlDataSource>




但这总是给我那个错误
服务器标签格式不正确.

请帮助我:)

最好的问候,
Ahmed Mandour




but it always gives me that error
The server tag is not well formed.

Please help me :)

Best Regards ,
Ahmed Mandour

推荐答案

ConnectionStrings:OpticsConnectionString %> " SelectCommand =" =" order_id) < /asp:SqlDataSource >
ConnectionStrings:OpticsConnectionString %>" SelectCommand="SELECT [pro_name], [pro_purchased_qty], [pro_sale_price], [Purchases_price] FROM [rpt_UVU_allOrders_In_Details_R] WHERE [order_id]"+'<%#"="+Eval("order_id") %>'> </asp:SqlDataSource>




但这总是给我那个错误
服务器标签格式不正确.

请帮助我:)

最好的问候,
艾哈迈德·曼杜(Ahmed Mandour)




but it always gives me that error
The server tag is not well formed.

Please help me :)

Best Regards ,
Ahmed Mandour


<%# Eval("order_id") %>绰绰有余.从表达式中删除"=".
<%# Eval("order_id") %> is more than enough I guess. Remove the "=" from the expression.


使用 SelectParameter

Use SelectParameter

<asp:SqlDataSource ID="SqlDataSource3" runat="server"

       ConnectionString="<%


这篇关于如何在SQLDataSource中使用绑定表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆