View Single Post
 
Old March 4th, 2008, 12:26 AM
greglh greglh is offline
Registered User
 
Join Date: Mar 2008
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default InitializeCulture causing Sqlexception Error...

I'm testing my site ready for deployment.
I used ASP.NET 2.0 as an example.
I was successful running thebeerhouse website to bring up the registration page.
My page is pretty much the same.
But I'm getting this error an it is taking too long to figure out, because I don't have a lot of free time to do it.

The DB is the same as well with a different name. My Script makes the necessary changes, but again I doubt this is the issue.


Any help would be appreciated. THKS!




=====================================
=
= Error
=
=====================================

CREATE DATABASE permission denied in database 'master'.
An attempt to attach an auto-named database for file c:\inetpub\wwwroot\goodsensesys\App_Data\GOODSENSE SYS.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.


protected override void InitializeCulture()
      {
         string culture = (HttpContext.Current.Profile as ProfileCommon).Preferences.Culture;
         this.Culture = culture;
         this.UICulture = culture;

      }


=====================================
=
= BasePage : The error is point at my InitializeCulture which is exactly the same as wrox.
= No using GSS.....store; because I'm not using a store. This should not make a difference.
=
=====================================


using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.Design;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using GSS.GoodSenseSys;
/// <summary>
/// Summary description for BasePage
/// </summary>
namespace GSS.GoodSenseSys.UI
{
    public class BasePage : System.Web.UI.Page
    {
            //
            // TODO: Add constructor logic here
            //

      protected override void InitializeCulture()
      {
         string culture = (HttpContext.Current.Profile as ProfileCommon).Preferences.Culture;
         this.Culture = culture;
         this.UICulture = culture;

      }



=====================================
=
= WebConfig : profile displayed below
=
=====================================

    <profile defaultProvider="GSS_ProfileProvider">
      <providers>
        <add name="GSS_ProfileProvider" connectionStringName="LocalSqlServer" 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" />

        <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" />

        </group>
      </properties>
    </profile>