title: How to change login database to PostgreSQL in sample C# ASP.NET WebForms application
body: <p>I want to use login system provided with WebForms template, but it is configured to use MSSQL LocalDB, I tried to switch it and here are the steps I've made so far:</p>
  
  <ol>
  <li>In Models\IdentityModels.cs replaced ": base("DefaultConnection")" to ": base("MyPgConnection")"</li>
  <li>DEBUG -> Exceptions... -> Marked all except "Common Language Runtime Exceptions"</li>
  <li>Started application, on first break - F11 - application started</li>
  <li>Registration -> login/password -> submit: got an error 'relation "undefined" doesn't exsist'. However in the pg database appeared table _MigrationHistory!</li>
  <li>Started application again, F11, excelption: 'relation "AspNetUsers" doesn't exsist': another table "AspNetRoles" appeared in Pg database!</li>
  <li>Third launch - again 'relation "AspNetUsers" doesn't exsist'</li>
  <li><p>Created a table similar to that in LocalDB</p>
  
  <pre><code>CREATE TABLE "AspNetUsers"
  (
    "Id" character varying(128) NOT NULL,
    "Email" text NOT NULL,
    "EmailConfirmed" boolean NOT NULL,
    "PasswordHash" text,
    "SecurityStamp" text,
    "PhoneNumber" text,
    "PhoneNumberConfirmed" boolean NOT NULL,
    "TwoFactorEnabled" boolean NOT NULL,
    "LockoutEndDateUtc" timestamp,
    "LockoutEnabled" boolean NOT NULL,
    "AccessFailedCount" integer NOT NULL,
    "UserName" text NOT NULL,
    CONSTRAINT "AspNetUsers_pkey" PRIMARY KEY ("Id")
  )
  WITH (
    OIDS=FALSE
  );
  ALTER TABLE "AspNetUsers"
    OWNER TO postgres;
  </code></pre></li>
  <li>Fourth Launch: exception Column Extent1.Discriminator doesn't exist</li>
  <li>Added "Discriminator" text NOT NULL, - exception: "Connection must be opened."</li>
  </ol>
  
  <p>No idea where to open the connection, please help!</p>