diff --git a/PMCProjekt/.vs/PMCProjekt/v17/.suo b/PMCProjekt/.vs/PMCProjekt/v17/.suo index 2e33bf8..3d2f057 100644 Binary files a/PMCProjekt/.vs/PMCProjekt/v17/.suo and b/PMCProjekt/.vs/PMCProjekt/v17/.suo differ diff --git a/PMCProjekt/.vs/PMCProjekt/v17/DocumentLayout.json b/PMCProjekt/.vs/PMCProjekt/v17/DocumentLayout.json index 1b8b627..ece5002 100644 --- a/PMCProjekt/.vs/PMCProjekt/v17/DocumentLayout.json +++ b/PMCProjekt/.vs/PMCProjekt/v17/DocumentLayout.json @@ -5,6 +5,9 @@ { "AbsoluteMoniker": "D:0:0:{7B328FFA-E441-4FED-8B99-C2B2453AA3E2}|PMCProjekt\\PMCProjekt.csproj|c:\\schule\\pmc\\pmcprojekt\\pmcprojekt\\pmcprojekt\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{7B328FFA-E441-4FED-8B99-C2B2453AA3E2}|PMCProjekt\\PMCProjekt.csproj|solutionrelative:pmcprojekt\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\bib\\AppData\\Local\\Temp\\6548756f-1fb5-487a-8435-26bbd99167cc_DBTest.7z.7cc\\DBTest\\DBTest\\Program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" } ], "DocumentGroupContainers": [ @@ -14,8 +17,21 @@ "DocumentGroups": [ { "DockedWidth": 200, - "SelectedChildIndex": 0, + "SelectedChildIndex": 1, "Children": [ + { + "$type": "Document", + "DocumentIndex": 1, + "Title": "Program.cs", + "DocumentMoniker": "C:\\Users\\bib\\AppData\\Local\\Temp\\6548756f-1fb5-487a-8435-26bbd99167cc_DBTest.7z.7cc\\DBTest\\DBTest\\Program.cs", + "RelativeDocumentMoniker": "..\\..\\..\\..\\Users\\bib\\AppData\\Local\\Temp\\6548756f-1fb5-487a-8435-26bbd99167cc_DBTest.7z.7cc\\DBTest\\DBTest\\Program.cs", + "ToolTip": "C:\\Users\\bib\\AppData\\Local\\Temp\\6548756f-1fb5-487a-8435-26bbd99167cc_DBTest.7z.7cc\\DBTest\\DBTest\\Program.cs [Schreibgesch\u00FCtzt]", + "RelativeToolTip": "..\\..\\..\\..\\Users\\bib\\AppData\\Local\\Temp\\6548756f-1fb5-487a-8435-26bbd99167cc_DBTest.7z.7cc\\DBTest\\DBTest\\Program.cs [Schreibgesch\u00FCtzt]", + "ViewState": "AQIAABUAAAAAAAAAAAAAACkAAAAAAAAA", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2024-06-12T10:19:37.026Z", + "EditorCaption": " [Schreibgesch\u00FCtzt]" + }, { "$type": "Document", "DocumentIndex": 0, @@ -24,7 +40,7 @@ "RelativeDocumentMoniker": "PMCProjekt\\Program.cs", "ToolTip": "C:\\Schule\\PMC\\PMCProjekt\\PMCProjekt\\PMCProjekt\\Program.cs", "RelativeToolTip": "PMCProjekt\\Program.cs", - "ViewState": "AQIAABIAAAAAAAAAAAAAAB4AAAAQAAAA", + "ViewState": "AQIAACUAAAAAAAAAAAAqwDcAAABAAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", "WhenOpened": "2024-05-29T10:43:22.805Z", "EditorCaption": "" diff --git a/PMCProjekt/PMCProjekt/Program.cs b/PMCProjekt/PMCProjekt/Program.cs index 0189027..db26ac2 100644 --- a/PMCProjekt/PMCProjekt/Program.cs +++ b/PMCProjekt/PMCProjekt/Program.cs @@ -27,18 +27,56 @@ // // • Nicht valide Datensätze von Nutzern sollen in einem Protokoll erfasst werden, ebenso bereits vorhandene Nutzer. // Der komplette Datensatz eines Nutzers darf dann nicht importiert werden -using System; -using System.IO; +using MySql.Data; +using MySql.Data.MySqlClient; +using MySqlX.XDevAPI; +using System.Data.Common; +using System.Reflection.PortableExecutable; +using System.Xml; namespace PMCProjekt { internal class Program { static void Main(string[] args) { + MySql.Data.MySqlClient.MySqlConnection myConnection; + string myConnectionString; + //set the correct values for your server, user, password and database name + myConnectionString = "server=localhost;uid=root;pwd=root;database=vr_contact"; + + try + { + myConnection = new MySql.Data.MySqlClient.MySqlConnection(myConnectionString); + //open a connection + myConnection.Open(); + + // create a MySQL command and set the SQL statement with parameters + MySqlCommand myCommand = new MySqlCommand(); + myCommand.Connection = myConnection; + myCommand.CommandText = @"SELECT * FROM workshop WHERE maxParticipants = @code;"; + myCommand.Parameters.AddWithValue("@code", "12"); + + // execute the command and read the results + using MySqlDataReader myReader = myCommand.ExecuteReader(); + + while (myReader.Read()) + { + int id = myReader.GetInt32("maxParticipants"); + string name = myReader.GetString("title"); + Console.WriteLine(id + " " + name); + } + + myConnection.Close(); + } + catch (MySql.Data.MySqlClient.MySqlException ex) + { + + } } } } + \ No newline at end of file diff --git a/PMCProjekt/PMCProjekt/obj/Debug/net8.0/PMCProjekt.AssemblyInfo.cs b/PMCProjekt/PMCProjekt/obj/Debug/net8.0/PMCProjekt.AssemblyInfo.cs index 0d71d08..462ec24 100644 --- a/PMCProjekt/PMCProjekt/obj/Debug/net8.0/PMCProjekt.AssemblyInfo.cs +++ b/PMCProjekt/PMCProjekt/obj/Debug/net8.0/PMCProjekt.AssemblyInfo.cs @@ -14,7 +14,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("PMCProjekt")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+3fb5238d9374de8dea9733fe57bbaddc206cb1fb")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+cbf9d009a817c48512e639ae3b82994e8bd14d2a")] [assembly: System.Reflection.AssemblyProductAttribute("PMCProjekt")] [assembly: System.Reflection.AssemblyTitleAttribute("PMCProjekt")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/PMCProjekt/PMCProjekt/obj/Debug/net8.0/PMCProjekt.AssemblyInfoInputs.cache b/PMCProjekt/PMCProjekt/obj/Debug/net8.0/PMCProjekt.AssemblyInfoInputs.cache index 98f6487..44d71ee 100644 --- a/PMCProjekt/PMCProjekt/obj/Debug/net8.0/PMCProjekt.AssemblyInfoInputs.cache +++ b/PMCProjekt/PMCProjekt/obj/Debug/net8.0/PMCProjekt.AssemblyInfoInputs.cache @@ -1 +1 @@ -c780602e073481f4ef18788846390401d87fddc4c990a6198134a514a9221afc +a1838728addb127ce57187402831e23d5da8b8644680230e2f61341fb5e73c1a