28 lines
534 B
C#
28 lines
534 B
C#
using Npgsql;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Configuration;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Management;
|
|
|
|
namespace DatenDB
|
|
{
|
|
static class DatenbankConnection
|
|
{
|
|
private static NpgsqlConnection connection = null;
|
|
|
|
public static NpgsqlConnection GetConnection()
|
|
{
|
|
if (connection == null)
|
|
{
|
|
connection = new NpgsqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
|
|
}
|
|
|
|
return connection;
|
|
}
|
|
|
|
}
|
|
}
|