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

  • Home
  • SEARCH
  • 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 8136945
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T10:55:32+00:00 2026-06-06T10:55:32+00:00

This is for an existing database with a View table. Trying to list a

  • 0

This is for an existing database with a View table.
Trying to list a View table, but came across this err msg in my Action:

CREATE DATABASE permission denied in database 'master'.

The view table to access is called: SomeTable

and if you run this on the database (ServerA_dev_alpha_custom):

sp_helptext 'SomeTable'

You’ll get this:

 CREATE VIEW dbo.[SomeTable] AS  SELECT * FROM ServerA_dev_alpha.dbo.[SomeTable]

Here’s the model:

public class SomeTable
{
    [Key]
    public virtual string SomeTableid  { set; get; }
    public virtual string name  { set; get; }
    public virtual string formvalue  { set; get; }
    public virtual string status  { set; get; }
    public virtual DateTime CreateDate { set; get; }    
}

The class name:

public class SomeDB: DbContext

Matches exactly to the connection string name:

    <add name ="SomeDB"
         connectionString ="data source=ServerA\DBSome; integrated Security=SSPI; initial catalog=ServerA_dev_alpha_custom"
         providerName="System.Data.SqlClient"/>

The err is found in creating the model:

SomeDB _db = new SomeDB();

var model = (from c in _db.SomeTable
  orderby c.CreateDate descending
  select c).Take(20);

When i change the connection string to point to where the table is defined: ServerA_dev_alpha (database) it works.

Any ideas?

  • 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-06T10:55:33+00:00Added an answer on June 6, 2026 at 10:55 am

    Even if you’ve an existing database setting the initializer to null works:

    Database.SetInitializer<SomeDB>(null);
    

    Second; forcing a mapping to the table name did the trick:

    modelBuilder.Entity<SomeTable>()
    .ToTable("SomeTable");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I looked through the existing questions of this kind but didn't find what I
I have an existing database(Postgresql). How can i create models from it? How can
I've created a view of a table on a MySQL database to enable another
I have to read an existing mongo database. Is mongoid suitable for this? All
I'm trying to create a ASP.NET MVC 2 webapp using the Northwind database following
I am trying to get the following working. I have a table view that
I need help to use jConfirm with this existing code (php & Jquery &
I can't get the JOIN syntax correct to alter this existing MySQL query in
I would like to see how this example of existing code would be able
I don't know how to add the this into my existing project. The only

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.