当使用SqlDataSource控件选择数据时,可以从两个属性:ConnectionString和SelectCommand开始,如下所示:
\n
<asp:SqlDataSource ID=”MySourceControlName” Runat=”server”
ConnectionString=”Server=MyServer ;
Database=Northwind”
SelectCommand=” SELECT Fieldl, [Field With Space] FROM MyTable”>
</asp:SglDataSource>\n
ConnectionString=”Server=MyServer ;
Database=Northwind”
SelectCommand=” SELECT Fieldl, [Field With Space] FROM MyTable”>
</asp:SglDataSource>\n