c# asp.net sqldatasource(6)
sqldatasource是用来从SQL Server、Oracle Server、ODBC数据源OLE DB数据源。或者windowsSQLCE数据库中的检索数据;
sqldatasource的声明:
<asp:SqlDataSource ID="SourceName" Runat="server"
ConnectionString="Server=MyServer ;
SelectCommand=" SELECT * FROM erea">
</asp:SglDataSource>
使用Windows认证时,添加的两个认证数据。
<asp:SqlDataSource ID="SourcName" Runat="server"
ConnectionString="
Server=MyServer ;
User ID=ueserID;
Password=userpassword;
Database=Northwind"
SelectCommand=" SELECT Field1, [Field With Space] FROM MyTable">
</asp:SqlDataSource>