Click here to Skip to main content
15,890,741 members
Home / Discussions / Database
   

Database

 
GeneralRe: OmniDB - An Open Source Web Tool For Database Management and Conversion Pin
Eddy Vluggen29-Apr-16 7:21
professionalEddy Vluggen29-Apr-16 7:21 
GeneralRe: OmniDB - An Open Source Web Tool For Database Management and Conversion Pin
Rafael T. Castro29-Apr-16 9:34
Rafael T. Castro29-Apr-16 9:34 
Questioni want to create data base by using c++ language Pin
Member 1249285029-Apr-16 0:01
Member 1249285029-Apr-16 0:01 
AnswerRe: i want to create data base by using c++ language Pin
Eddy Vluggen29-Apr-16 0:26
professionalEddy Vluggen29-Apr-16 0:26 
AnswerRe: i want to create data base by using c++ language Pin
ZurdoDev29-Apr-16 8:09
professionalZurdoDev29-Apr-16 8:09 
QuestionChange Data Capture is not capturing before value for the Images Pin
indian14327-Apr-16 11:17
indian14327-Apr-16 11:17 
AnswerRe: Change Data Capture is not capturing before value for the Images Pin
Eddy Vluggen29-Apr-16 6:44
professionalEddy Vluggen29-Apr-16 6:44 
QuestionEnable-Migrations, I don't get it - EF6 Pin
jkirkerx23-Apr-16 13:36
professionaljkirkerx23-Apr-16 13:36 
So my program is almost complete, and I'm trying to enable migrations in my project.

I did the package command -Enable-Migration -EnableAutmaticMigration

Here's the part I don't get.
I wrote a Intializer that makes the database and seeds it with data, which works fines.
Here I call the class I made show below in the first class
public indigoDBContext() : base("DefaultConnection")
{
    // Enable the Intializer
    Database.SetInitializer(new indigoIntializer());
}
Then I ran PM -EnableMigrations -EnableAutomaticMigrations
And my Intializer file changed, it added a class called Configuration, what I am suppose to do with this class?, OK, so I changed the commented code to my seed code.
class indigoIntializer : CreateDatabaseIfNotExists<indigoDBContext>
{
    protected override void Seed(indigoDBContext context)
    {
        base.Seed(context);

<pre>
    // Seed the Website Adminsitrator Table
    siteAdministrators.seed(context);

    // Seed the Website Countries and States
    countries.seed(context);
    states_Provinces.seed(context);
    salesTax.seed(context);
    avatars.seed(context);
    themes.seed(context);
    paymentGateways.seed(context);
    paymentBrands.seed(context);

}

}

class Configuration : DbMigrationsConfiguration<indigodbcontext>
{
public Configuration()
{
AutomaticMigrationsEnabled = true;
ContextKey = "Indigo.DataAccessLayer.indigoDBContext";
}

protected override void Seed(Indigo.DataAccessLayer.indigoDBContext context)
{
base.Seed(context);

// Seed the Website Adminsitrator Table
siteAdministrators.seed(context);

// Seed the Website Countries and States
countries.seed(context);
states_Provinces.seed(context);
salesTax.seed(context);
avatars.seed(context);
themes.seed(context);
paymentGateways.seed(context);
paymentBrands.seed(context);
}
}

Then it added a file called Configurations.cs in a Migration folder, so I added my seed code to that as well.
internal sealed class Configuration : DbMigrationsConfiguration<Indigo.DataAccessLayer.indigoDBContext>
{
    public Configuration()
    {
        AutomaticMigrationsEnabled = true;
    }

    protected override void Seed(Indigo.DataAccessLayer.indigoDBContext context)
    {
        base.Seed(context);

        // Seed the Website Adminsitrator Table
        siteAdministrators.seed(context);

        // Seed the Website Countries and States
        countries.seed(context);
        states_Provinces.seed(context);
        salesTax.seed(context);
        avatars.seed(context);
        themes.seed(context);
        paymentGateways.seed(context);
        paymentBrands.seed(context);
    }
}

Questions:
Am I suppose to have the database created when I when the package commands?
Or do create the database and then run the package commands?

I don't understand what I'm suppose initialize with, my original code, or the new code. I tried the new code in the first example, but could not get the call right.

And then this Add-Migration, I sort of get it, I write code to change the database, and call the function with Add-Migration "Function"

And the Update-Database, I always get the multiple something error.

Guess I need help fixing my plan or design for Migrations.

And I need help fixing my post here. I just started writing in c# and I missing something in wrapping my code examples here.
QuestionImproving Performance of Dynamic Sql Pin
indian14319-Apr-16 12:25
indian14319-Apr-16 12:25 
SuggestionRe: Improving Performance of Dynamic Sql Pin
CHill6020-Apr-16 2:50
mveCHill6020-Apr-16 2:50 
GeneralRe: Improving Performance of Dynamic Sql Pin
indian14326-Apr-16 7:55
indian14326-Apr-16 7:55 
AnswerRe: Improving Performance of Dynamic Sql Pin
Oscar Salgado9-Aug-16 12:44
Oscar Salgado9-Aug-16 12:44 
QuestionImproving Performance of my SP which is looping using While Pin
indian14318-Apr-16 12:54
indian14318-Apr-16 12:54 
AnswerRe: Improving Performance of my SP which is looping using While Pin
Chris Quinn19-Apr-16 0:45
Chris Quinn19-Apr-16 0:45 
QuestionHow to sum consecutive in number of day Pin
hmanhha14-Apr-16 8:10
hmanhha14-Apr-16 8:10 
AnswerRe: How to sum consecutive in number of day Pin
Richard MacCutchan14-Apr-16 20:52
mveRichard MacCutchan14-Apr-16 20:52 
GeneralRe: How to sum consecutive in number of day Pin
hmanhha14-Apr-16 22:04
hmanhha14-Apr-16 22:04 
GeneralRe: How to sum consecutive in number of day Pin
Richard MacCutchan14-Apr-16 22:11
mveRichard MacCutchan14-Apr-16 22:11 
AnswerRe: How to sum consecutive in number of day Pin
John C Rayan15-Apr-16 4:47
professionalJohn C Rayan15-Apr-16 4:47 
QuestionReport is time out Pin
Member 1083678514-Apr-16 1:42
Member 1083678514-Apr-16 1:42 
AnswerRe: Report is time out Pin
Richard Deeming14-Apr-16 1:56
mveRichard Deeming14-Apr-16 1:56 
GeneralRe: Report is time out Pin
Member 1083678514-Apr-16 2:21
Member 1083678514-Apr-16 2:21 
GeneralRe: Report is time out Pin
Richard Deeming14-Apr-16 2:24
mveRichard Deeming14-Apr-16 2:24 
GeneralRe: Report is time out Pin
Member 1083678514-Apr-16 2:39
Member 1083678514-Apr-16 2:39 
GeneralRe: Report is time out Pin
Richard Deeming14-Apr-16 8:28
mveRichard Deeming14-Apr-16 8:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.