Merge branch 'main' of https://git.bib.de/PBG2H23ASA/HAG_BIB_Projekt
# Conflicts: # PrototypWPFHAG/PrototypWPFHAG.csproj
This commit is contained in:
commit
a8d19abc13
@ -1,4 +1,5 @@
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
@ -9,6 +10,8 @@ using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using MahApps.Metro.Controls;
|
||||
using Npgsql;
|
||||
using Npgsql.Replication;
|
||||
|
||||
namespace PrototypWPFHAG;
|
||||
|
||||
@ -20,5 +23,47 @@ public partial class MainWindow : MetroWindow
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
TestConnection();
|
||||
Console.ReadKey();
|
||||
|
||||
}
|
||||
|
||||
private static void TestConnection()
|
||||
{
|
||||
using (NpgsqlConnection con = GetConnection())
|
||||
{
|
||||
con.Open();
|
||||
if (con.State == ConnectionState.Open)
|
||||
{
|
||||
Console.WriteLine("Connected to Server");
|
||||
}
|
||||
}
|
||||
}
|
||||
private static NpgsqlConnection GetConnection()
|
||||
{
|
||||
return new NpgsqlConnection(@"Server=localhost;Port=5432;User Id=postgres;Password=postgres;Database=postgres;");
|
||||
}
|
||||
|
||||
//class Program
|
||||
//{
|
||||
// static void Main(string[] args)
|
||||
// {
|
||||
// TestConnection();
|
||||
// Console.ReadKey();
|
||||
// }
|
||||
// private static void TestConnection()
|
||||
// {
|
||||
// using(NpgsqlConnection con = GetConnection()){
|
||||
// con.Open();
|
||||
// if (con.State == ConnectionState.Open) {
|
||||
// Console.WriteLine("Connected to Server");
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// private static NpgsqlConnection GetConnection()
|
||||
// {
|
||||
// return new NpgsqlConnection(@"Server=localhost;Port=5432;User Id=postgres;Password=postgres;Database=TestServer;");
|
||||
// }
|
||||
//}
|
||||
}
|
@ -1,7 +1,11 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<<<<<<< HEAD
|
||||
<OutputType>WinExe</OutputType>
|
||||
=======
|
||||
<OutputType>Exe</OutputType>
|
||||
>>>>>>> 37891877377e624f7138e6c6075bdf6cd8650a0e
|
||||
<TargetFramework>net9.0-windows</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
|
Loading…
x
Reference in New Issue
Block a user