7 Replies - 182 Views - Last Post: 11 February 2020 - 01:20 PM Rate Topic: -----

#1 dtgeek   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 01-August 19

Having trouble add items to my electrical.db3 with FluentMigrator

Posted 11 February 2020 - 12:36 PM

I used the old programmer setting and changed the coder every time I run it it does add the items.


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FluentMigrator;

namespace Migrations.Migrations
{
    [Migration(2)]
    public class V2_0_0/>/>_1 : Migration
    {
        public override void Down()
        {
            throw new NotImplementedException();
        }

        public override void Up()
        {
            
            Insert.IntoTable("Items").Row(new { EriNumber = "60070124", EriNumberSearch = 60070124, FKLevel = 5, FKWorkgroup = 129, FKStatus = 1, FKManufacturer = 1546, UPC = "91920", CatalogNumber = "PW-100-24-W", Description = "White PIR Wall OcpSensor 24V", FKUOM = 2, Retail = 73.60, Cost = 35.32, MyCost = 35.32, DoNotUpdate = false, MyMultiplier = 1, Labor = 0.4, EffectiveDate = @"10 /29/2018", ImKing = true, Comparative = "60070024", AlphaIndex = 4094, InHouse = false, ReportGroup = 4094, LastCostUpdate = @"11/25/2018  9:10:08 PM", ParentID = 0, FK_CommodityID = 162982, RowID = "f690e3c3-6828-4d95-83b8-9cf6c0fd9a20", ImageUrl = "http://www.electricalresources.com/nepg/images/ws%1.tif", DateAdded = DateTime.Now, DateModified = DateTime.Now, AddedBy = "Admin", ModifiedBy = "Admin", DefaultCostCode = 0 });
           
        }
    }
}



Is This A Good Question/Topic? 0
  • +

Replies To: Having trouble add items to my electrical.db3 with FluentMigrator

#2 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15506
  • View blog
  • Posts: 62,083
  • Joined: 12-June 08

Re: Having trouble add items to my electrical.db3 with FluentMigrator

Posted 11 February 2020 - 12:39 PM

You neglected to ask a question or explain what is happening (correctly or wrongly).
Was This Post Helpful? 0
  • +
  • -

#3 dtgeek   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 01-August 19

Re: Having trouble add items to my electrical.db3 with FluentMigrator

Posted 11 February 2020 - 12:43 PM

I'm sorry every time I run the code no errors but the items are not added to the electrical.db3 database file I just gave one item but have 5 items to add to the table called items.
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15506
  • View blog
  • Posts: 62,083
  • Joined: 12-June 08

Re: Having trouble add items to my electrical.db3 with FluentMigrator

Posted 11 February 2020 - 12:45 PM

Mkay.. so what is " Insert.IntoTable"?

Is that part of FluentMigrator or something else?
Was This Post Helpful? 0
  • +
  • -

#5 dtgeek   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 01-August 19

Re: Having trouble add items to my electrical.db3 with FluentMigrator

Posted 11 February 2020 - 12:47 PM

yes it is the first migration is done the way to add to the table called items
Was This Post Helpful? 0
  • +
  • -

#6 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15506
  • View blog
  • Posts: 62,083
  • Joined: 12-June 08

Re: Having trouble add items to my electrical.db3 with FluentMigrator

Posted 11 February 2020 - 12:59 PM

Does the table exist?
Are the right connection strings and services set up?
Are there any exceptions you are not catching?
Was This Post Helpful? 0
  • +
  • -

#7 dtgeek   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 01-August 19

Re: Having trouble add items to my electrical.db3 with FluentMigrator

Posted 11 February 2020 - 01:10 PM

yes it does exists I copied from the first migration and then replace the data with the new items
Was This Post Helpful? 0
  • +
  • -

#8 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15506
  • View blog
  • Posts: 62,083
  • Joined: 12-June 08

Re: Having trouble add items to my electrical.db3 with FluentMigrator

Posted 11 February 2020 - 01:20 PM

*shrug* Okey dokey.

Well, there's not enough information to go on so, good luck.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1