IT/IT ::asp.NET

ASP.NET 에서 데이터 베이스와 연결 예제

골든 2014. 1. 9. 17:54

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

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

            SelectCommand="SELECT id, name, tel FROM Product WHERE (id = 'c')"></asp:SqlDataSource>


        <asp:ListBox ID="ListBox1" runat="server" DataSourceID="SqlDataSource1" 

            DataTextField="id" DataValueField="id"></asp:ListBox>