using System;
using Npgsql;
namespace db01
{
class Program
{
static void Main(string[] args){
//接続文字列
NpgsqlConnection conn = new NpgsqlConnection("Server=localhost;Port=5432;User ID=postgres;Database=postgres;Password=Chatdb01;Enlist=true");
//PostgreSQLへ接続
conn.Open();
NpgsqlCommand cmd = new NpgsqlCommand("select version()", conn);
var serverversion = (String)cmd.ExecuteScalar();
Console.WriteLine("PostgreSQL server version: {0}", serverversion);
conn.Close();
}
}
}
More than 3 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme
List of users who liked
00