ADO Net Database ASP.Net Tutorial

You represent a database connection string with the SqlDataSource control's ConnectionString property. 
<%@ Page Language="C#" %>
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">


    Show Local Connection


    
    

            id="grdProducts"
        DataSourceID="srcProducts"
        Runat="server" />
            id="srcProducts"
        SelectCommand="SELECT * FROM Products"
        ConnectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|MyDatabase.mdf;Integrated Security=True;User Instance=True"
        Runat="server" />