ADO Net Database ASP.Net Tutorial

<%@ Page Language="VB" AutoEventWireup="false"%>


    Untitled Page


    
    

                                   runat="server" 
                           ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="SELECT DISTINCT [Genre] FROM [Books] ORDER BY [Genre]">
         

        Choose a genre:
                                  runat="server" 
                          AutoPostBack="True" 
                          DataSourceID="SqlDataSource1"
                          DataTextField="Genre" 
                          DataValueField="Genre">
        
        
                                   runat="server" 
                           ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="SELECT * FROM [Books] WHERE ([Genre] = @Genre)">
            
                                                      Name="Genre" 
                                      PropertyName="SelectedValue"
                                      Type="String" />
            

        
                              runat="server" 
                      AutoGenerateColumns="False" 
                      BackColor="White"
                      DataKeyNames="BookID"
                      DataSourceID="booksDataSource" 
                      ForeColor="Black" 
                      GridLines="Vertical">
            
            
                                                HeaderText="BookID" 
                                InsertVisible="False" 
                                ReadOnly="True"
                                SortExpression="BookID" />
                
                
                
                
                
                
                
            

            
            
            
            
            
        
    


File: Web.config


  
             connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\MyFirstDatabase.mdf;Integrated Security=True;User Instance=True"
         providerName="System.Data.SqlClient" />