Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old March 4th, 2008, 12:26 AM
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>

  #2 (permalink)  
Old March 12th, 2008, 08:45 PM
Registered User
 
Join Date: Mar 2008
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I've gone through various processes to recreate the DB to see if that is the issue, but after 8 new versions I get the same thing.

I created the DB through the aspnet_regsql tool.


Something to do with Culture and UICulture.

When I try to use the ASPNET Config tool to add users I get errors too.


I used the scripts CreateAll, but still no luck.
The scripts require too much modification to run it through VS2005 because it doesn't recognize the same syntax like GO, etc...
I can connect using VS2005 Server Explorer or Sql2005 Mangement Tool.
This is holding up everything because I can't test for deployment with DB errors.

My files are located in inetpub directory with IIS 5.0 running.



  #3 (permalink)  
Old March 14th, 2008, 11:16 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Atlanta, Georgia, USA.
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I don't understand why you think the Culture has anything to do with the error you specified. The error message you gave has a detailed explanation of the issue. You need to study that message and check the things it's telling you to check. We can't do it for you.

This is the 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.

This is the detailed explanation:
A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

So you have 3 things to check on. Actually 2, since there is no UNC path here.

Eric



Similar Threads
Thread Thread Starter Forum Replies Last Post
Catching a SQLException error digriz60 ASP.NET 1.0 and 1.1 Basics 5 January 14th, 2008 03:14 PM
SqlException error akibaMaila VB.NET 2002/2003 Basics 3 August 25th, 2005 09:14 AM
java.sql.SQLException: Error loading JDBC Driver jdphjp Java Databases 1 August 5th, 2004 12:46 AM
Refresh causing Query Engine Error Deecay Crystal Reports 0 July 10th, 2003 09:27 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.