Skip to content

johnv-oesc/NpgsqlDemo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NpgsqlDemo

This project shows how to use Ngpsql to connect a C# console app to the Pagila database.

  • Fork this repo on GitHub.

  • Go to Visual Studio to clone your forked repo.

    • Git menu -> Clone Repository
    • Under Browse Repositories, click the GitHub button.
    • Select your NgpsqlDemo repo and click Clone.
  • Go to Solution Explorer in Visual Studio

    • Right-click NpgsqlDemo
      • Select Manage Nuget Packages
      • Browse
        • Search for Microsoft.Extensions.Configuration
          • Install
        • Search for Microsoft.Extensions.Configuration.Json
          • Install
        • Search for Npgsql
          • Install
    • Right-click NpgsqlDemo
      • Add -> New Item
      • Name the file appsettings.json
  • Paste this code in appsettings.json:

  "ConnectionStrings": {
    "Pagila": "Host=YOURSERVERNAME;Port=5432;Database=pagila;Username=YOURUSERNAME;Password=YOURPASSWORD"
  }
}```

About

Database SQL demo for C# class - Metro Tech

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • C# 100.0%