Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8713161
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:16:33+00:00 2026-06-13T05:16:33+00:00

I program website with MVC 3.0 which uses EntityFrame work 4.0, In controller layer

  • 0

I program website with MVC 3.0 which uses EntityFrame work 4.0, In controller layer I Have this:

  public ViewResult Index()
    {
     return View(_DatabaseSMSEntities.People.ToList());
    }

And in View Layer I used Telerik Grid:

<% Html.Telerik().Grid<ProjectWebsite.Models.People>(Model)
                    .Name("People")
                    .Columns(columns =>
                    {
                        columns.Bound(o => o.PersonID).Format(
                         "<a href='../WebPage/PersonSMSPage.aspx?personID=" + "{0}" + @"' <br/>runat=""server"">" +
                         "<img src='../../Content/themes/base/images/RegisterSMS.png' <br/>alt='{0}' />"<br/>
                        );                                           

                    })
                    .RowAction(row =>
                    {
                        if (row.Index == 0)
                        { row.DetailRow.Expanded = false; }
                    })                   
                     .Render();%>

I published it in IIS 7.0. But it does not work.

<connectionStrings>
    <add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient" />
    <add name="DatabaseSMSEntities" connectionString="metadata=res://*/Models.ModelDatabaseSMS.csdl|res://*/Models.ModelDatabaseSMS.ssdl|res://*/Models.ModelDatabaseSMS.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\DatabaseSMS.mdf;Integrated Security=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />
    <add name="cn1" connectionString="data source=~/ErrorsLog/Errors.db" />
  </connectionStrings>

First, I published it in D:\Pardis, But I got error:

   CREATE DATABASE permission denied in database 'master'.
    An attempt to attach an auto-named database for file D:\Pardis\App_Data\DatabaseSMS.mdf failed. A database with the same name
exists, or specified file cannot be opened, or it is located on UNC share.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Data.SqlClient.SqlException: CREATE DATABASE permission denied in database 'master'.
An attempt to attach an auto-named database for file D:\Pardis\App_Data\DatabaseSMS.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

Source Error: 


Line 20:         public ViewResult Index()
Line 21:         {
Line 22:             return View(_DatabaseSMSEntities.People.ToList());
Line 23:         }
Line 24: 

Then, I published it in Inetup but I got error.
I do not have ASPNET user in user list to set security.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T05:16:35+00:00Added an answer on June 13, 2026 at 5:16 am

    There might be two problems

    1. You forgot to copy your database file (If you are using sql server compact)
    2. You are creating a new database through code. You should not be creating databases in your deployment environment. This can probably happen if you are using

      System.Data.Entity.Database.SetInitializer(some strategy)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I write a program to verify this website: www.alipay.com which root CA cert should
I have this program that check a website, and I want to know how
I'm working on the MVC Pattern Winforms example project from this website Program.cs static
I have been trying to compile the program on this website and got most
I have an AJAX program which gets data from the website and posts the
I am writing a Java program which automatically plugs information into a website, which
I'm making a Java program that accesses a website, which depends on handing out
use this website a lot but first time posting. My program creates a number
This program builds a dictionary out of a list based on what two index
Does anyone know of a free website or program which will take a string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.