Tuesday, March 25, 2014

The Entity Framework (often referred to as EF) supports a development paradigm called Code First. Code First allows you to create model objects by writing simple classes. (These are also known as POCO classes, from "plain-old CLR objects.") You can then have the database created on the fly from your classes, which enables a very clean and rapid development workflow. If you are required to create the database first, you can still follow this tutorial to learn about MVC and EF app development.

Creating a Connection String and Working with SQL Server LocalDB

The MovieDBContext class you created handles the task of  connecting to the database and mapping Movieobjects to database  records. One question you might ask, though, is how to specify which database it will connect to. You don't actually have to specify which database to use,  Entity Framework will default to using  LocalDB. In this section we'll explicitly add  a connection string in the Web.config file of the application.

SQL Server Express LocalDB

LocalDB is a lightweight version of the SQL Server Express Database Engine that starts on demand and runs in user mode. LocalDB runs in a special execution mode of SQL Server Express that enables you to  work with databases as .mdf files. Typically, LocalDB database files  are kept in the App_Data folder of a web project.
SQL Server Express is not recommended for use in production web applications. LocalDB in particular should not be used for production with a web application because it is not designed to work with IIS. However, a LocalDB  database can be easily migrated to SQL Server or SQL Azure.
In Visual Studio 2013 (and in 2012), LocalDB is installed by default with Visual Studio.
By default, the Entity Framework looks for a connection string named the same as the object context class (MovieDBContext for this project).  For more  information see  SQL Server Connection Strings for ASP.NET Web Applications.
Find  the <connectionStrings>  element:
Add the following connection string to the <connectionStrings>  element in the Web.config file.
<add name="MovieDBContext" 
   connectionString="Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\Movies.mdf;Integrated Security=True" 
   providerName="System.Data.SqlClient" 
/> 
The following example shows a portion of the Web.config file with  the new connection string added:
<connectionStrings>
    <add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;AttachDbFilename=|DataDirectory|\aspnet-MvcMovie-20130603030321.mdf;Initial Catalog=aspnet-MvcMovie-20130603030321;Integrated Security=True" providerName="System.Data.SqlClient" />
    <add name="MovieDBContext"    connectionString="Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\Movies.mdf;Integrated Security=True" providerName="System.Data.SqlClient"
/>

Monday, March 24, 2014

bootstrap

<div class="content row">
    <div class="col-lg-12">
        <header class="clearfix">
            <section id="branding">
                <a href="index.php"><img src="images/misc/ralogo_monogram.png" alt="Logo for Roux Conference"></a>
            </section><!-- branding -->

            <section class="navbar">
                <ul class="nav navbar-nav">
                    <li><a href="index.php">Home</a></li>
                    <li><a href="venuetravel.php">Venue/Travel</a></li>
                    <li><a href="schedule.php">Schedule</a></li>
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Artists <span class="caret"></span></a>
                        <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu">
                            <li><a tabindex="-1" href="artists.php">All artists</a></li>
                            <li class="divider"></li>
                          <li><a tabindex="-1" href="artists.php#Barot_Bellingham">Barot Bellingham</a></li>
                          <li><a tabindex="-1" href="artists.php#Gerard_Donahue">Gerard Donahue</a></li>
                          <li><a tabindex="-1" href="artists.php#Jonathan_Ferrar">Jonathan Ferrar</a></li>
                          <li><a tabindex="-1" href="artists.php#Lorenzo_Garcia">Lorenzo Garcia</a></li>
                          <li><a tabindex="-1" href="artists.php#Hillary_Goldwynn">Hillary Goldwynn</a></li>
                          <li><a tabindex="-1" href="artists.php#Hassum_Harrod">Hassum Harrod</a></li>
                          <li><a tabindex="-1" href="artists.php#Jennifer_Jerome">Jennifer Jerome</a></li>
                          <li><a tabindex="-1" href="artists.php#LaVonne_LaRue">LaVonne LaRue</a></li>
                          <li><a tabindex="-1" href="artists.php#Riley_Rewington">Riley Rewington</a></li>
                          <li><a tabindex="-1" href="artists.php#Constance_Smith">Constance Smith</a></li>
                          <li><a tabindex="-1" href="artists.php#Xhou_Ta">Xhou Ta</a></li>
                          <li><a tabindex="-1" href="artists.php#Richard_Tweed">Richard Tweed</a></li>
                        </ul><!-- dropdown menu -->
                    </li>
                    <li><a href="register.php">Register</a></li>
                </ul><!-- nav -->
            </section><!-- navbar -->

        </header><!-- header -->
    </div><!-- column -->
</div><!-- content -->