找到你要的答案

Q:Create New Database from MVC application

Q:创建MVC应用新的数据库

My application offers Registration option and once the registration is approved i have to create a seperate Database for the newly created user

For every User we have a set of excercises to map and the structre is like

Level [ Id Name ] -  Total 5 levels 
Questions [Id LevelId Question] - 5 Questions in every Level
UserQuestionsMap [Id userId QuestionId] - 25 questions will be mapped for every user

I want to create a new database for every user on the registration approval process with the master tables Level , Questions and UserQuestionsMap

How can i do this? User1Db , User2Db ,......, Db etc with the master tables and values on it

I am using EntityFramework models for Registartion and approval process So is there any easy way of automating the process of db creation

我的应用程序提供了注册选项,一旦核准注册的我要创建一个新创建的用户单独的数据库

每个用户,我们有一套训练图和结构是一样的

Level [ Id Name ] -  Total 5 levels 
Questions [Id LevelId Question] - 5 Questions in every Level
UserQuestionsMap [Id userId QuestionId] - 25 questions will be mapped for every user

I want to create a new database for every user on the registration approval process with the master tables Level , Questions and UserQuestionsMap

我该怎么做?user1db,user2db,......,上主表和值dB等

I am using EntityFramework models for Registartion and approval process So is there any easy way of automating the process of db creation

answer1: 回答1:

I don't understand the need for creating new DB in your case, but you can always separate data on logical levels.

Means, you can introduce 'comapany'/'user' table where data will be different for each company/user depends on their unique id.

Why to create multiple databases and add to the cost.

我不知道在您的情况下需要创建新的DB,但您可以始终在逻辑级别上分离数据。

意味着,你可以介绍的公司/用户的数据表,将各公司/用户的不同取决于他们独特的ID。

为什么要创建多个数据库并增加成本。

mysql  sql-server  asp.net-mvc