Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > BOOK: ASP.NET 3.5 Website Programming Problem Design Solution
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: ASP.NET 3.5 Website Programming Problem Design Solution
This is the forum to discuss the Wrox book ASP.NET 3.5 Website Programming Problem Design Solution by Chris Love; ISBN: 978-0-470-18758-6
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 3.5 Website Programming Problem Design Solution section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 7th, 2009, 03:21 PM
Authorized User
 
Join Date: Nov 2007
Location: , , .
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default Has anyone got this working with VWDE 2008 / SQL Express 2008?

Chris doesn't include any install instructions for his source code.

I've downloaded the vb zip and database zip, but not sure how to proceed.

I want to open a website folder that I can compile and run.

1) What files and folders should it contain?
2) Presumably I copy downloaded database into App_Data folder?
3) What changes are needed in the web.config file?
4) What references, if any, are required?
5) Anything else to do?

If I can get the VB version running that would be a great start, though I'd rather use the C# version, but I think this still has some bugs.
  #2 (permalink)  
Old January 15th, 2010, 04:27 PM
Registered User
 
Join Date: Jan 2010
Posts: 8
Thanks: 0
Thanked 1 Time in 1 Post
Default works with C# and VWDE 2008 -- Vista

I was able to get it to compile and run.

Your solution in VWDE will have 2 folders--BeerHouse35 and TBHBLL.

Yes, unzip the database files in App_Data.

The main thing that got it to work was having the correct connection strings in web.config (BeerHouse35) and in App.Config (TBHBLL). I am willing to share these 2 files if you desire. Please let me know.

Thanks, Mohamed
  #3 (permalink)  
Old January 17th, 2010, 01:58 PM
Authorized User
 
Join Date: Nov 2007
Location: , , .
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Smile Pllease let me know connection string info

Hi Mohamed

Many thanks for your reply, I'm glad you managed to get this code working.

Would you please list your connection string settings.
  #4 (permalink)  
Old January 17th, 2010, 03:48 PM
Registered User
 
Join Date: Jan 2010
Posts: 8
Thanks: 0
Thanked 1 Time in 1 Post
Default my web.config and App.Config files

web.config

Code:
<?xml version="1.0"?>
<configuration>
	<configSections>
		<section name="theBeerHouse" type="TheBeerHouseSection, TBHBLL, Version=3.5.0.1, Culture=neutral, PublicKeyToken=null"/>
		<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
			<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
				<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
				<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
					<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
					<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
					<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
					<section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
				</sectionGroup>
			</sectionGroup>
		</sectionGroup>
		<sectionGroup name="elmah">
			<!-- NOTE! If you are using ASP.NET 1.x then remove the
                 requirePermission="false" attribute from the section
                 elements below as those are only needed for
                 partially trusted applications in ASP.NET 2.0 -->
			<section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah"/>
			<section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah"/>
			<section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah"/>
			<section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah"/>
		</sectionGroup>
	</configSections>
	<theBeerHouse defaultConnectionStringName="TheBeerHouseEntities" siteDomainName="[SiteDomain]">
		<contactForm mailTo="thebeerhouse@wrox.com"/>
		<articles pageSize="10" twitterUrserName="[TwitterUserName]" twitterPassword="[Password]" enableTwitter="true"
				  akismetKey="[Key]" enableAkismet="True"/>
		<polls archiveIsPublic="true" votingLockByIP="false"/>
		<newsletters fromEmail="thebeerhouse@wrox.com" fromDisplayName="TheBeerHouse" archiveIsPublic="true"
					 hideFromArchiveInterval="10"/>
		<forums threadsPageSize="8" hotThreadPosts="10" bronzePosterPosts="10" silverPosterPosts="20" goldPosterPosts="50"/>
		<store sandboxMode="true" businessEmail="thebeerhouse@wrox.com"/>
		<gallery></gallery>
		<calendar></calendar>
	</theBeerHouse>
	<elmah>
		<security allowRemoteAccess="0"/>
		<!--
            Use to log errors to Microsoft SQL Server 2000 or 2005
            using ASP.NET 2.0. Set value of connectionStringName attribute
            to the name of the connection string settings to use from
            the <connectionStrings> section.
        -->
		<errorLog type="Elmah.SqlErrorLog, Elmah" connectionStringName="ASPNETDBConnectionString"/>
		<!--
            Use to log errors to Microsoft SQL Server 2000 or 2005
            using ASP.NET 1.x and adjust the value of connectionString 
            attribute to your settings.

        <errorLog type="Elmah.SqlErrorLog, Elmah" 
            connectionString="Data Source=.;Initial Catalog=ELMAH;Trusted_Connection=True" />
        -->
		<!--
            Use to log errors to SQLite using ASP.NET 2.0. 
            Set value of connectionStringName attribute to 
            the name of the connection string settings to 
            use from the <connectionStrings> section.
            
        <errorLog type="Elmah.SQLiteErrorLog, Elmah" connectionStringName="..." />
        
            The format of the connection string should be as follows:
            
        <connectionStrings>
          <add name="..." connectionString="data source=[path to the database file]" />
        </connectionStrings>
            
            Replace the content of the brackets with a file name, for example:
            
        data source=C:\Elmah.db
            
            If the database file doesn't exist it is created automatically.
            To specify a path relative to and below the application root, 
            start with the root operator (~) followed by a forward slash (/), 
            as it is common in ASP.NET applications. For example:
            
        data source=~/App_Data/Error.db
        -->
		<!--
            Use to log errors into separate XML files that are stored on 
            disk at the path specified in the logPath attribute.

        <errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="..." />
        -->
		<!--
            Use to send error reports by e-mail and adjust the attributes
            according to settings desired. Note that only the from and
            to attributes are required. The rest are optional and may
            be removed. If the SMTP server does not require authentication,
            you MUST remove the userName and password attributes or
            set them to empty values (resulting in zero-length strings).
            If you are using ELMAH compiled for .NET Framework 1.x, then
            the to attribute may contain multiple recipient addresses,
            each of which must be delimited by a semi-colon(;). If you are 
            using ELMAH compiled for .NET Framework 2.0 or later, then the
            to attribute may contain multiple recipient addresses,
            each of which must be delimited by a comma (,).

        <errorMail 
            from="error@ExtremeWebWorks.com" 
            to="info@extremewebworks.com" 
            subject="Exception in the Beer House Site"
            async="true"
            smtpPort="25"
            smtpServer="mail.extremewebworks.com"/>
        
            Use to prevent errors from being mailed or logged based on
            assertions/conditions provided under the <test> element.
            The example below will filter errors of type HttpException
            where the status code is 404 (in other words, where the
            resource was not found).
-->
		<errorFilter>
			<test>
				<equal binding="HttpStatusCode" value="404" valueType="Int32"/>
			</test>
		</errorFilter>
	</elmah>
	<system.web.extensions>
		<scripting>
			<webServices>
				<authenticationService enabled="true" requireSSL="false"/>
				<profileService enabled="true" readAccessProperties="FirstName, LastName"/>
				<roleService enabled="true"/>
			</webServices>
			<scriptResourceHandler enableCompression="true" enableCaching="true"/>
		</scripting>
	</system.web.extensions>
	<appSettings/>
	<connectionStrings>
		
		<add name="TheBeerHouseEntities" connectionString="metadata=res://*;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Users\mkarmali\desktop\thebeerhouse-c-3.5\beerhouse35\App_Data\aspnetdb.mdf;Integrated Security=True;User Instance=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient"/>
    <add name="ASPNETDBConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Users\mkarmali\desktop\thebeerhouse-c-3.5\beerhouse35\App_Data\aspnetdb.mdf;Integrated Security=True;User Instance=True"
   providerName="System.Data.SqlClient" />

  </connectionStrings>
	<system.web>
		<siteMap defaultProvider="TBHSiteMapProvider" enabled="true">
			<providers>
				<add name="TBHSiteMapProvider" type="TBHSiteMapProvider" securityTrimmingEnabled="true"/>
			</providers>
		</siteMap>
		<!-- 
            Set compilation debug="true" to insert debugging 
            symbols into the compiled page. Because this 
            affects performance, set this value to true only 
            during development.

            Visual Basic options:
            Set strict="true" to disallow all data type conversions 
            where data loss can occur. 
            Set explicit="true" to force declaration of all variables.
        -->
		<compilation debug="true" strict="false" explicit="true">
			<assemblies>
				<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
				<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
				<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
				<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
				<add assembly="System.Data.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
				<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
				<add assembly="System.Web.Extensions.Design, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
				<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
				<add assembly="System.Web.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
			</assemblies>
		</compilation>
		<pages theme="DarkBeer" masterPageFile="~/TBHMain.master" maintainScrollPositionOnPostBack="true">
			<namespaces>
				<clear/>
				<add namespace="TheBeerHouse"/>
				<add namespace="TheBeerHouse.Web.UI"/>
				<add namespace="TheBeerHouse.BLL"/>
				<add namespace="System"/>
				<add namespace="System.Collections"/>
				<add namespace="System.Collections.Generic"/>
				<add namespace="System.Collections.Specialized"/>
				<add namespace="System.Configuration"/>
				<add namespace="System.Text"/>
				<add namespace="System.Text.RegularExpressions"/>
				<add namespace="System.Linq"/>
				<add namespace="System.Xml.Linq"/>
				<add namespace="System.Web"/>
				<add namespace="System.Web.Caching"/>
				<add namespace="System.Web.SessionState"/>
				<add namespace="System.Web.Security"/>
				<add namespace="System.Web.Profile"/>
				<add namespace="System.Web.UI"/>
				<add namespace="System.Web.UI.WebControls"/>
				<add namespace="System.Web.UI.WebControls.WebParts"/>
				<add namespace="System.Web.UI.HtmlControls"/>
				<add namespace="AjaxControlToolkit"/>
			</namespaces>
			<!--http://weblogs.asp.net/scottgu/archive/2006/11/26/tip-trick-how-to-register-user-controls-and-custom-controls-in-web-config.aspx-->
			<controls>
				<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
				<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
				<add tagPrefix="asp" namespace="AjaxControlToolkit" assembly="AjaxControlToolkit, Version=3.0.20820.16598, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e"/>
				<add tagPrefix="asp" namespace="TheBeerHouse.Web.UI" assembly="TBHBLL, Version=3.5.0.1, Culture=neutral, PublicKeyToken=null"/>
				<add tagPrefix="FCKeditorV2" namespace="FredCK.FCKeditorV2" assembly="FredCK.FCKeditorV2"/>
				<add tagPrefix="uc1" src="~/controls/UserProfile.ascx" tagName="UserProfile"/>
				<add tagPrefix="uc1" src="~/controls/PollBox.ascx" tagName="PollBox"/>
				<add tagPrefix="uc1" src="~/controls/ShoppingCartBox.ascx" tagName="ShoppingCartBox"/>
				<add tagPrefix="uc1" src="~/controls/Featuredproduct.ascx" tagName="Featuredproduct"/>
				<add tagPrefix="uc1" src="~/controls/NewsletterBox.ascx" tagName="NewsletterBox"/>
				<add tagPrefix="uc1" src="~/controls/FooterCopyright.ascx" tagName="FooterCopyright"/>
				
			</controls>
		</pages>
		<!--
            The <authentication> section enables configuration 
            of the security authentication mode used by 
            ASP.NET to identify an incoming user. 
        -->
		<authentication mode="Forms">
			<forms cookieless="AutoDetect" loginUrl="~/AccessDenied.aspx" name="TBHFORMAUTH"/>
		</authentication>
		<!--
            The <customErrors> section enables configuration 
            of what to do if/when an unhandled error occurs 
            during the execution of a request. Specifically, 
            it enables developers to configure html error pages 
            to be displayed in place of a error stack trace.
        -->
		<!--
		<sessionState mode="Custom" customProvider="SessionStoreProvider" timeout="20">
			<providers>
				<add name="SessionStoreProvider" type="System.Data.Caching.SessionStoreProvider, ClientLibrary"/>
			</providers>
		</sessionState>
-->
		<trace pageOutput="false" enabled="false"/>
		<roleManager enabled="true" cacheRolesInCookie="true" cookieName="TBHROLES" defaultProvider="TBH_RoleProvider">
			<providers>
				<add connectionStringName="ASPNETDBConnectionString" applicationName="/" name="TBH_RoleProvider" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
			</providers>
		</roleManager>
		<webParts enableExport="true">
			<personalization defaultProvider="TBH_PersonalizationProvider">
				<providers>
					<add name="TBH_PersonalizationProvider" connectionStringName="ASPNETDBConnectionString" type="System.Web.UI.WebControls.WebParts.SqlPersonalizationProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
				</providers>
				<authorization>
					<allow roles="Administrators,Editors" verbs="enterSharedScope"/>
				</authorization>
			</personalization>
		</webParts>
		<machineKey validationKey="287C5D125D6B7E7223E1F719E3D58D17BB967703017E1BBE28618FAC6C4501E910C7E59800B5D4C2EDD5B0ED98874A3E952D60BAF260D9D374A74C76CB741803" decryptionKey="5C1D8BD9DF3E1B4E1D01132F234266616E0D5EF772FE80AB" validation="SHA1"/>
		<customErrors mode="RemoteOnly" defaultRedirect="~/Error.aspx">
			<error statusCode="404" redirect="~/GenericError.aspx?code=404"/>
			<error statusCode="408" redirect="~/GenericError.aspx?code=408"/>
			<error statusCode="505" redirect="~/GenericError.aspx?code=505"/>
		</customErrors>
		<urlMappings>
			<add url="~/articles/beer.aspx" mappedUrl="~/BrowseArticles.aspx?CatID=28"/>
			<add url="~/articles/events.aspx" mappedUrl="~/BrowseArticles.aspx?CatID=41"/>
			<add url="~/articles/news.aspx" mappedUrl="~/BrowseArticles.aspx?CatID=31"/>
			<add url="~/articles/photos.aspx" mappedUrl="~/BrowseArticles.aspx?CatID=40"/>
			<add url="~/articles/blog.aspx" mappedUrl="~/BrowseArticles.aspx?CatID=29"/>
			<add url="~/articles/faq.aspx" mappedUrl="~/BrowseArticles.aspx?CatID=42"/>
		</urlMappings>
		<httpHandlers>
			<remove verb="*" path="*.asmx"/>
			<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
			<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
			<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
			<add verb="*" path="forum.rss" validate="false" type="RSSForum, TBHBLL, Version=3.5.0.1, Culture=neutral, PublicKeyToken=null"/>
			<add verb="*" path="Products.rss" validate="false" type="ProductsRSS, TBHBLL, Version=3.5.0.1, Culture=neutral, PublicKeyToken=null"/>
			<add verb="*" path="*.rss" validate="false" type="TheBeerHouse.RSSFeed, TBHBLL, Version=3.5.0.1, Culture=neutral, PublicKeyToken=null"/>
			<add verb="*" path="*.ics" validate="false" type="vCalHandler, TBHBLL, Version=3.5.0.1, Culture=neutral, PublicKeyToken=null"/>
			<add verb="GET" path="sitemap.xml" validate="false" type="TBHBLL.Navigation.SiteMapsHandler, TBHBLL, Version=3.5.0.1, Culture=neutral, PublicKeyToken=null"/>
			<!-- 
                This entry provides the UI for the error log at
                elmah.axd below the application path. For example,
                if your domain is www.example.com and your application
                is at the root, then you can view the error log by
                visiting the following URL:
                
                http://www.example.com/elmah.axd
                
                IMPORTANT! To secure this location, consult the
                following notes:
                
                http://code.google.com/p/elmah/wiki/SecuringErrorLogPages
            -->
			<add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah"/>
		</httpHandlers>
		<httpModules>
			<remove name="WindowsAuthentication"/>
			<remove name="PassportAuthentication"/>
			<add name="URLRewrite" type="TheBeerHouse.URLRewrite, TBHBLL, Version=3.5.0.1, Culture=neutral, PublicKeyToken=null"/>
			<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah"/>
			<!-- 
                Uncomment the entries below if error mail reporting 
                and filtering is desired.
            -->
			<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah"/>
			<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah"/>
			<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
		</httpModules>
		<anonymousIdentification cookieless="AutoDetect" enabled="true"/>
		<profile defaultProvider="TBH_ProfileProvider">
			<providers>
				<add name="TBH_ProfileProvider" connectionStringName="ASPNETDBConnectionString" applicationName="/" type="System.Web.Profile.SqlProfileProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
			</providers>
			<properties>
				<add name="FirstName" type="String"/>
				<add name="LastName" type="String"/>
				<add name="Gender" type="String"/>
				<add name="BirthDate" type="DateTime"/>
				<add name="Occupation" type="String"/>
				<add name="Website" type="String"/>
				<add name="ShoppingCart" type="TheBeerHouse.Store.ShoppingCart" serializeAs="Binary" allowAnonymous="true"/>
				<group name="Forum">
					<add name="Posts" type="Int32"/>
					<add name="AvatarUrl" type="String"/>
					<add name="Signature" type="String"/>
				</group>
				<group name="Address">
					<add name="Street" type="String"/>
					<add name="PostalCode" type="String"/>
					<add name="City" type="String"/>
					<add name="State" type="String"/>
					<add name="Country" type="String"/>
				</group>
				<group name="Contacts">
					<add name="Phone" type="String"/>
					<add name="Fax" type="String"/>
				</group>
				<group name="Preferences">
					<add name="Theme" type="String" allowAnonymous="true"/>
					<add name="Culture" type="String" defaultValue="en-US"/>
					<add name="Newsletter" type="BLL.Newsletters.SubscriptionType"/>
				</group>
			</properties>
		</profile>
		<membership defaultProvider="TBH_MembershipProvider" userIsOnlineTimeWindow="15">
			<providers>
				<add name="TBH_MembershipProvider" connectionStringName="ASPNETDBConnectionString" applicationName="/" enablePasswordRetrieval="true" enablePasswordReset="true" requiresQuestionAndAnswer="true" requiresUniqueEmail="true" passwordFormat="Encrypted" maxInvalidPasswordAttempts="5" passwordAttemptWindow="10" minRequiredPasswordLength="5" minRequiredNonalphanumericCharacters="0" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
				<!--
            <add name="TBH_MembershipProviderEx"
					connectionStringName="ASPNETDBConnectionString"
					applicationName="/"
					enablePasswordRetrieval="true"
					enablePasswordReset="true"
					requiresQuestionAndAnswer="true"
					requiresUniqueEmail="true"
					passwordFormat="Encrypted"
					maxInvalidPasswordAttempts="5"
					passwordAttemptWindow="10"
					minRequiredPasswordLength="5"
					minRequiredNonalphanumericCharacters="0"
					type="MB.TheBeerHouse.DAL.SqlClient.SqlMembershipProviderEx, __code"
            />
            -->
			</providers>
		</membership>
	</system.web>
  
	<location path="AddEditPost.aspx">
		<system.web>
			<authorization>
				<allow roles="Administrators,Editors,Moderators,Posters"/>
				<deny users="*"/>
			</authorization>
		</system.web>
	</location>
	<location path="EditProfile.aspx">
		<system.web>
			<authorization>
				<deny users="?"/>
				<allow users="*"/>
			</authorization>
		</system.web>
	</location>
	<location path="OrderHistory.aspx">
		<system.web>
			<authorization>
				<deny users="?"/>
				<allow users="*"/>
			</authorization>
		</system.web>
	</location>

	<location path="Admin">
		<system.web>
			<authorization>
				<allow roles="Administrators" />
				<deny users="*" />
			</authorization>
		</system.web>
	</location>
  
  
	<!-- 
        The following entry denies unauthenticated users access to 
        the path from where ELMAH's handlers are accessible. If you 
        have role-based security implemented, you SHOULD consider 
        instead allowing access by a particular role (for example, 
        operators and administrators).
        
        IMPORTANT: If you change the path of the handler above
        then you MUST also change the path in the location tag below
        to be the same.

        For more information, see:
        http://code.google.com/p/elmah/wiki/SecuringErrorLogPages
    -->
	<location path="elmah.axd">
		<system.web>
			<authorization>
				<deny users="?" />
			</authorization>
		</system.web>
	</location>
	<system.net>
		<mailSettings>
			<smtp from="">
				<network host=""/>
			</smtp>
		</mailSettings>
	</system.net>
	<system.codedom>
		<compilers>
			<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
				<providerOption name="CompilerVersion" value="v3.5"/>
				<providerOption name="OptionInfer" value="true"/>
				<providerOption name="WarnAsError" value="false"/>
			</compiler>
		</compilers>
	</system.codedom>
	<!-- 
        The system.webServer section is required for running ASP.NET AJAX under Internet
        Information Services 7.0.  It is not necessary for previous version of IIS.
    -->
	<system.webServer>
		<validation validateIntegratedModeConfiguration="false"/>
		<modules>
			<remove name="ScriptModule"/>
			<add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
		</modules>
		<handlers>
			<remove name="WebServiceHandlerFactory-Integrated"/>
			<remove name="ScriptHandlerFactory"/>
			<remove name="ScriptHandlerFactoryAppServices"/>
			<remove name="ScriptResource"/>
			<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
			<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
			<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
		</handlers>
	</system.webServer>
	<runtime>
		<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
			<dependentAssembly>
				<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
				<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
			</dependentAssembly>
			<dependentAssembly>
				<assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
				<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
			</dependentAssembly>
		</assemblyBinding>
	</runtime>
	<system.serviceModel>
		<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
	</system.serviceModel>
</configuration>
App.Config

Code:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <connectionStrings>
    <add name="ArticlesEntities" connectionString="metadata=res://*/Navigation.SiteMapModel.csdl|res://*/Navigation.SiteMapModel.ssdl|res://*/Navigation.SiteMapModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Users\mkarmali\desktop\thebeerhouse-c-3.5\beerhouse35\App_Data\aspnetdb.mdf;Integrated Security=True;User Instance=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />
    <add name="ShoppingEntities" connectionString="metadata=res://*/Store.ShoppingModel.csdl|res://*/Store.ShoppingModel.ssdl|res://*/Store.ShoppingModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Users\mkarmali\desktop\thebeerhouse-c-3.5\beerhouse35\App_Data\aspnetdb.mdf;Integrated Security=True;User Instance=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />
    <add name="GalleryEntities" connectionString="metadata=res://*/Gallery.GalleryModel.csdl|res://*/Gallery.GalleryModel.ssdl|res://*/Gallery.GalleryModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Users\mkarmali\desktop\thebeerhouse-c-3.5\beerhouse35\App_Data\aspnetdb.mdf;Integrated Security=True;User Instance=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />
    <add name="SiteMapEntities" connectionString="metadata=res://*/Navigation.SiteMapModel.csdl|res://*/Navigation.SiteMapModel.ssdl|res://*/Navigation.SiteMapModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Users\mkarmali\desktop\thebeerhouse-c-3.5\beerhouse35\App_Data\aspnetdb.mdf;Integrated Security=True;User Instance=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />
    <add name="TheBeerHouse.Properties.Settings.ASPNETDBConnectionString"
      connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Users\mkarmali\Desktop\TheBeerHouse-C-3.5\BeerHouse35\App_Data\ASPNETDB.MDF;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient" />

  </connectionStrings>
</configuration>
John: Change the database path to yours and also add a Data Source to the project and use the connection string name to yours. Open these two files in VWDE so that the formating makes it readable.

I hope this works for you. Please let me know if it works or you have other problems.
Mohamed
The Following User Says Thank You to mkarmali For This Useful Post:
  #5 (permalink)  
Old January 18th, 2010, 01:16 PM
Authorized User
 
Join Date: Jul 2008
Location: , , .
Posts: 29
Thanks: 0
Thanked 2 Times in 2 Posts
Send a message via MSN to docluv
Default

The app.config oly matters for the EF designer, just an FYI. It is not used when the application is running.
__________________
http://Professionalaspnet.com
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Vista Home Premium and SQL Express 2008 tdewey BOOK: ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solutio 6 January 9th, 2010 07:53 PM
Getting sample code working with VWDE 2008 john77 BOOK: ASP.NET 3.5 Website Programming Problem Design Solution 0 November 4th, 2009 04:03 PM
Installing SQL Server 2008 Express Edition with Tools Kevin7777 BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 3 March 8th, 2009 05:14 AM
SQL 2008 will not run on Windows 2008? dkrus Book: Professional Microsoft SQL Server 2008 Administration ISBN: 978-0-470-24796-9 1 February 23rd, 2009 12:34 PM
Downloading VB 2008 Express Kiddi Visual Basic 2008 Essentials 1 June 11th, 2008 12:29 PM



All times are GMT -4. The time now is 02:02 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.