How to re-create Personal.mdf

Last post 06-22-2009 1:31 AM by caruncool. 21 replies.

Sort Posts:

  • How to re-create Personal.mdf

    09-17-2008, 7:16 AM

    Good morning -

    My name is Demirelli and I'm new to the forum, thank You for having me.  I have been working with the Personal Starter Kit and everything works fine on my XP machines.  However, recently, I got a Vista machine.  I am running the latest Visual Web Developer / SQL , bot Express versions.  The application builds fine.  However, when I try to deploy to browser, I get the following error:

    "Database 'C:\USERS\DEMIRELLI\DOCUMENTS\VISUAL STUDIO 2008\WEBSITES\PERSONALWEBSITE5\APP_DATA\PERSONAL.MDF' cannot be upgraded because its non-release version (607) is not supported by this version of SQL Server. You cannot open a database that is incompatible with this version of sqlservr.exe. You must re-create the database.
    Could not open new database 'C:\USERS\DEMIRELLI\DOCUMENTS\VISUAL STUDIO 2008\WEBSITES\PERSONALWEBSITE5\APP_DATA\PERSONAL.MDF'. CREATE DATABASE is aborted.
    An attempt to attach an auto-named database for file C:\Users\Demirelli\Documents\Visual Studio 2008\WebSites\PersonalWebSite5\App_Data\Personal.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share."

    ------------------------

    I have done some research and it seems like I have to manually re-create the sql database, I guess this is a Vista issue.  However, I downloaded the manual scripts from the starter kit website and tried to run the add-personal.sql file but it did not work.  I'd be more than grateful for any assistance.  Thank You in advance.

     

    - Demirelli,

    http://www.TurkishImports.TV

    http://www.EvilEyePromo.com

     

  • Re: How to re-create Personal.mdf

    10-01-2008, 5:49 AM
    • Member
      6 point Member
    • wi_alpha_geek
    • Member since 07-07-2008, 12:56 AM
    • Posts 4

     I am having this exact same issue. I tried to connect the personal.mdf file to my SQL Server using the Managment Studio but it seem to be missing the log file for the personal.mdf.

  • Re: How to re-create Personal.mdf

    10-12-2008, 10:48 PM
    • Member
      4 point Member
    • Serk4
    • Member since 10-13-2008, 2:36 AM
    • Posts 2

    I had the same error message.  It's not a Vista thing, rather it's a 2005 vs. 2008 thing.  Open the project in Visual Studio 08 and delete the Personal.mdf in the App_Data folder.  Recreate it, add the two tables and add the stored procedures.  It might help to have it open in VS 05 so you can copy/paste.  Also, note that when you paste in the stored proc code you'll have to change ALTER to CREATE.  Once you save the proc, VS will change it back to ALTER.  So far it's been working for me...Yes

  • Re: How to re-create Personal.mdf

    10-25-2008, 10:43 PM
    • Member
      4 point Member
    • mreaves2008
    • Member since 10-26-2008, 2:40 AM
    • Posts 3

    Thanks for that Serk4, but when you say "recreate it", do you mean in something like Query Analyser,.. in other word, run the SQL to recreate the tables / procs?  How do I do that.  If that's the way, which tool should I use?

     

  • Re: How to re-create Personal.mdf

    10-27-2008, 12:48 AM
    • Member
      4 point Member
    • Serk4
    • Member since 10-13-2008, 2:36 AM
    • Posts 2

    Recreate it in Visual Studio Express 2008.  Right click App_Data folder > Add New item... > SQL Server Database.

  • Re: How to re-create Personal.mdf

    10-30-2008, 4:46 PM
    • Member
      2 point Member
    • petectaylor
    • Member since 10-04-2008, 11:07 AM
    • Posts 1

    Hi I am wrestling with the same problem.

    However I can't open the personal web site with visual studio 2005 either.

    I have deleted personal.mdf in the Visual Studio 2008 website but dont know the table formats to recreate manaually

    I cant connect to the database with SQL server 2008either so cant copy the tables from there either

    Any guidance or insights available?

    Many thanks

    Petet

  • Re: How to re-create Personal.mdf

    10-30-2008, 8:56 PM
    • Member
      4 point Member
    • mreaves2008
    • Member since 10-26-2008, 2:40 AM
    • Posts 3

    I solved this by, deleting the *.mdf file, creating a new database (see above) and creating the tables & stored proc again using the personal-add.sql code in the SQL 2008 mgmt studio.

    I had to add permissions to the database folder for the user called SQLServerMSSQLuser$[hostname]$SQLExpress....

    I got one of the other starter kits that uses a DB working then I established the same permissions.

    I hope that helps.  I'm no pro.  It took me most of the day.

    Cheers,

    Mike

  • Re: How to re-create Personal.mdf

    11-17-2008, 10:10 AM
    • Member
      2 point Member
    • Ashley H
    • Member since 10-11-2008, 12:00 PM
    • England
    • Posts 5

     

    petectaylor:

      I can't open the personal web site with visual studio 2005 either.

    mreaves2008:

    I solved this by, deleting the *.mdf file, creating a new database (see above) and creating the tables & stored proc again using the personal-add.sql code in the SQL 2008 mgmt studio.

    I have the exact same problem except my SQL mgmt Studio is refusing to connenct to the database saying:

    SQL Server:

     Logintimeout expired
    A Network-related or instance specific error has occurred while establishing a connection to SQL Server. Server is not found or is not accessable. Check if instance name is correct and if SQL Server is configured to allow remote connections.

     

     I have configured SQL to allow remote connections but I am still getting this. I am using SQL Server 2005 Mgmt Studio Express.

     Anyone know how to get around this?

     Regards,

     Ashley H

     

  • Re: How to re-create Personal.mdf

    12-04-2008, 10:45 PM
    • Member
      2 point Member
    • jordanchap
    • Member since 12-05-2008, 3:34 AM
    • Posts 1
    I am new to this whole thing. Could you provide details on how to recreate it for someone like me who doesn't know what they are doing? Thanks!
  • Re: How to re-create Personal.mdf

    12-21-2008, 10:40 AM
    • Member
      2 point Member
    • mrshjosey
    • Member since 12-21-2008, 3:17 PM
    • Posts 1

    i have been struggeling along with the recreation also. (and new to all this)

    What i did is following:

    1. Delete the personal.mdf file in the server explorer
    2. create a new one by right click on Data connection (add-connection) 
    3. Look at the content of the "personal-add.sql" file (in Data-app folder in solution explorer). Here you find what basically is code to create the 2 tables and various Stored-procedures.
    4. Follow the code and create the items by hand. (actually 5 min work)

    for all procudures:

    1. right click on "stored procedures" and choose "add-new"
    2. copy/paste each of the 11 procedures as found in de sql(each one starting with CREATE and stopping after each RETURN)

    As for the tables: 

    1. create new table
    2. colums are called AlbumID, Caption and IsPublic
    3. data type ins int, nvarchar(50) and bit
    4. al ticks are falls (not null)
    5. AlbumID is primary key (right click row for options)

    in code in the SQL that looks like

    CREATE TABLE [Albums] (
    [AlbumID] [int]
    IDENTITY (1, 1) NOT NULL ,
    [Caption] [nvarchar] (50)
    COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
    [IsPublic] [bit]
    NOT NULL
    ) ON [PRIMARY]
     

    When done with the 2nd table click relations in the menu and set a relation between AlbumID in de Albums table and the AlbumID field in the Photos table. Set the last 2 options to cascade. Close relations window.
    In the sql code this looks like

    ALTER TABLE [Photos]
    ADD CONSTRAINT [FK_Photos_Albums] FOREIGN KEY ([AlbumID])
    REFERENCES [Albums] ([AlbumID])
    ON DELETE CASCADE
    ON UPDATE CASCADE

    All done. I hope this will help and i didnt take the effort for nothing...lol
    PS: dont forget to give yourself some admin rights. This is done though the menu “website” option “ASP.NET configuration”. The screen that comes up will explain itself.
     

     

  • Re: How to re-create Personal.mdf

    01-03-2009, 6:43 PM
    • Member
      55 point Member
    • RaeKC
    • Member since 11-28-2008, 10:52 PM
    • Posts 338
    deleted
  • Re: How to re-create Personal.mdf

    01-03-2009, 6:47 PM
    • Member
      55 point Member
    • RaeKC
    • Member since 11-28-2008, 10:52 PM
    • Posts 338

     anyway you could attach the Personal mdf and log files you created?

    ( am i lazy or what??? Big Smile i'm just too tired of dealing with this project to try all that again. I did try re-creating the table once without success. )

     

    Rachel

  • Re: How to re-create Personal.mdf

    01-03-2009, 9:36 PM
    • Contributor
      7,249 point Contributor
    • whighfield
    • Member since 01-02-2006, 10:37 PM
    • Winterpeg, Manitoba
    • Posts 1,205

    Here is the stock *.mdf and *.ldf files for the personal web starter kit.

    http://cid-1ca24298b541b070.skydrive.live.com/self.aspx/.Public/pwsk%7C_personal%7C_db.zip?lc=1033

    Please mark the most helpful reply/replies as "Answer".

    - William
    http://thefrozencoder.ca
  • Re: How to re-create Personal.mdf

    01-03-2009, 11:47 PM
    • Member
      55 point Member
    • RaeKC
    • Member since 11-28-2008, 10:52 PM
    • Posts 338

     If that's the one that comes with the starter kit, then it doesn't help. Visual Studio 2008 needs a new version for 2008.

     But thanks anyways.

     Rachel

  • Re: How to re-create Personal.mdf

    03-03-2009, 4:26 PM
    • Member
      2 point Member
    • aurrevan
    • Member since 03-03-2009, 9:19 PM
    • Posts 1

    This was the most helpful posting I found on the subject. ThanksBig Smile

Page 1 of 2 (22 items) 1 2 Next >