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 6473347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:27:21+00:00 2026-05-25T06:27:21+00:00

Im fairly new to ASP.NET MVC 3, and to coding in general really. I

  • 0

Im fairly new to ASP.NET MVC 3, and to coding in general really.

I have a very very small application i want to upload to my webhosting domain.

I am using entity framework, and it works fine on my local machine.
I’ve entered a new connection string to use my remote database instead however it dosen’t really work, first of all i have 1 single MSSQL database, which cannot be de dropped and recreated, so i cannot use that strategy in my initializer, i tried to supply null in the strategy, but to no avail, my tables simply does not get created in my database and thats the problem, i don’t know how i am to do that with entity framework.

When i run the application, it tries to select the data from the database, that part works fine, i just dont know how to be able to create those tabes in my database through codefirst.

I could probaly get it to work through manually recreating the tables, but i want to know the solution through codefirst.

This is my initializer class

public class EntityInit : DropCreateDatabaseIfModelChanges<NewsContext>
{
    private NewsContext _db = new NewsContext();


    protected override void Seed(NewsContext context)
    {
        new List<News>
        {
            new News{ Author="Michael Brandt", Title="Test News 1 ", NewsBody="Bblablabalblaaaaa1" },
            new News{ Author="Michael Brandt", Title="Test News 2 ", NewsBody="Bblablabalblaaaaa2" },
            new News{ Author="Michael Brandt", Title="Test News 3 ", NewsBody="Bblablabalblaaaaa3" },
            new News{ Author="Michael Brandt", Title="Test News 4 ", NewsBody="Bblablabalblaaaaa4" },
        }.ForEach(a => context.News.Add(a));


        base.Seed(context);
    }
}

As i said, im really new to all this, so excuse me, if im lacking to provide the proper information you need to answer my question, just me know and i will answer it

  • 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-05-25T06:27:21+00:00Added an answer on May 25, 2026 at 6:27 am

    If you are using a very small application, you maybe could go for SQL CE 4.0.
    The bin-deployment should allow you to run SQL CE 4.0 even if your provider doesn’t have the binaries installed for it. You can read more here.

    That we you can actually use whatever initializer you want, since you now don’t have the problem of not being able to drop databases and delete tables.

    could this be of any help?

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

Sidebar

Related Questions

I have developed a fairly small asp.net MVC application using the repository pattern and
Fairly new to asp.net Mvc and jquery. Have the following code working fine, but
I'm fairly new to asp.net mvc and I have a question. Example model: public
I'm fairly new to ASP.NET MVC, and I'm having a little trouble with scripts...
So I am fairly new to ASP.NET MVC and Windows Live Connect API. Basically
I am fairly new at using the ASP.NET MVC framework and was hoping that
I'm fairly new to ASP MVC so go easy :). I have a form
I'm fairly new to ASP.NET MVC and I've got a problem with Html.TextBoxFor() -
First some brief background: I have an existing ASP.NET MVC 1 application using Entity
I'm fairly new to using AJAX in ASP.NET (although I am very familiar with

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.