.Net SqlDataSource标记SelectCommand [英] .Net SqlDataSource tag SelectCommand

查看:83
本文介绍了.Net SqlDataSource标记SelectCommand的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是关于

<asp:SqlDataSource ID="SqlDataSource2" runat="server" 
            ConnectionString="<%$ ConnectionStrings:conStr %>" 
             SelectCommand="SELECT * " +
                            "FROM myTable">
        </asp:SqlDataSource>

显然我已经给出了一个示例,但是为什么不让我将sql语句扩展到几行呢?

Obviously I have given an example but why won't it let me spread the sql statement over a couple of lines?

谢谢,R.

推荐答案

如果要在多行中编写查询,请在不进行串联的情况下编写该查询:

If you want to write your query in multiple lines write it without the concatenation like that :

<asp:SqlDataSource ID="SqlDataSource2" runat="server" 
     ConnectionString="<%$ ConnectionStrings:conStr %>" 
     SelectCommand="SELECT * 
                   FROM myTable">
</asp:SqlDataSource>

这篇关于.Net SqlDataSource标记SelectCommand的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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