One of the new features within ASP.NET Whidbey is a set of DataSource controls. The controls allow developers to bind data using a declarative syntax within an ASPX page. Let's take a look at a sample.
<asp:sqldatasource
id="SqlDataSource1"
runat="server"
selectcommand="select customerid, companyname from customers"
providername="System.Data.OleDb"
connectionstring="Provider=SQLOLEDB.1;Integrated Security=SSPI;
Persist Security Info=False;Initial Catalog=Northwind;
Data Source=localhost;Use Procedure for Prepare=1;
Auto Translate=True;Packet Size=4096;Workstation ID=SERVER1;
Use Encryption for Data=False;
Tag with column collation when possible=False">
</asp:sqldatasource>
The above control sets up a connection to a Sql Server database that other controls can now use to populate themselves. To setup a control to use the SqlDataSource control declared above you set the datasourceid of the control you would like to bind the data to.
<asp:dropdownlist
id="DropDownList1"
runat="server"
datavaluefield="customerid"
datasourceid="SqlDataSource1"
datatextfield="companyname"
autopostback="True">
</asp:dropdownlist>
When I frist saw some examples of the new data source controls I thought they seemed like a decent idea, however, the more I think about the implications of using the controls the more I'm beginning to think they're asking for trouble. Having the details of data connections interspersed with presentation code is simply not a good idea. I have a couple buddies who are just learning the .NET ropes and these types of features worry me.