Question: sorry for the question being ambiguous, but I found it hard to word the title right.

I have a super class with a method called calculateTotal() and a method called toString().
I also have a sub class that overrides both method.

The problem I'm having is, when I call toString() from subclass, super.toString() portion returns a string with the value returned from calculateTotal() from subclass.
Therefore I'm getting same value for Total: and Grand Total:, both being the value of handlingFee added.

To illustrate the problem, here is an example output.

Expected Output: Total: 20, Plus a handling charge of $4, Grand Total: $24

Current Output: Total: 24, Plus a handling charge of $4, Grand Total: $24

Any help or suggestion would be appreciated! Thank you,

Codes:

Super Class: 

```
public class SuperClass {
    private double unitPrice;
    private int quantityOrdered;

    public double calculateTotal() {

        return unitPrice * quantityOrdered;
    }

    public String toString() {

        return String.format("\nUnit Price: %.2f\nQuantity Ordered: %d\nTotal: %.2f", unitPrice, quantityOrdered, calculateTotal());
    }
}

```

Sub Class: 

```
public class SubClass extends SuperClass {

    private double handlingFee;
    public double calculateTotal() {

        return unitPrice * quantityOrdered + handlingFee;
    }

    public String toString() {

        return String.format("%s\nPlus a $%.2f handling charge\nGrand Total: $%.2f", super.toString(), handlingFee, calculateTotal());
    }
}

```

Answer: 
You can pass extra parameters to `update-database` that allow to:

* Specify a different connection string
* Generate a SQL script that you can apply yourself to the target DB

Full syntax of `Update-Database`:

```
Update-Database [-SourceMigration <String>] [-TargetMigration <String>]
[-Script] [-Force] [-ProjectName <String>] [-StartUpProjectName <String>] 
[-ConfigurationTypeName <String>] [-ConnectionStringName <String>] 
[<CommonParameters>]

Update-Database [-SourceMigration <String>] [-TargetMigration <String>] 
[-Script] [-Force] [-ProjectName <String>] [-StartUpProjectName <String>] 
[-ConfigurationTypeName <String>] -ConnectionString <String> 
-ConnectionProviderName <String> [<CommonParameters>]

```

To specify a connection string (which points to the correct folder in your project):

* `-StartUpProjectName` and `-ConnectionStringName`, to specify a project that contains a .config file with a connection string with the provided name (1st syntax)
* `-ConnectionString`, to specify directly the connection string (2nd syntax)

To create a SQL script that you can apply directly to the DB using other tool:

* `-SourceMigration`: current migration in the destination DB `-TargetMigration`: migration to update to, and `-Script`: to generate a script taht you can apply by hand
@JotaBe's answer is correct. But to summise, you need to do the following:

```
add-migration "MigrationName" -ProjectName Sharp.Data -ConnectionString "ConnectionStringToYourTargetDatabaseHere"

```