Ideenfindung + Dokumentation + Leichte Änderungen
This commit is contained in:
parent
5be00c2e03
commit
b5daf727d0
Binary file not shown.
Binary file not shown.
@ -24,7 +24,7 @@
|
|||||||
"RelativeDocumentMoniker": "Projekt_Calcan_Conze\\Program.cs",
|
"RelativeDocumentMoniker": "Projekt_Calcan_Conze\\Program.cs",
|
||||||
"ToolTip": "C:\\Jan_bib_Module\\PMC\\Projekt\\Projekt_Calcan_Conze\\Projekt_Calcan_Conze\\Program.cs",
|
"ToolTip": "C:\\Jan_bib_Module\\PMC\\Projekt\\Projekt_Calcan_Conze\\Projekt_Calcan_Conze\\Program.cs",
|
||||||
"RelativeToolTip": "Projekt_Calcan_Conze\\Program.cs",
|
"RelativeToolTip": "Projekt_Calcan_Conze\\Program.cs",
|
||||||
"ViewState": "AQIAAAwAAAAAAAAAAAAAAB4AAAAgAAAA",
|
"ViewState": "AQIAACkAAAAAAAAAAAAAwDcAAAAgAAAA",
|
||||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||||
"WhenOpened": "2024-05-24T09:06:25.212Z",
|
"WhenOpened": "2024-05-24T09:06:25.212Z",
|
||||||
"EditorCaption": ""
|
"EditorCaption": ""
|
||||||
|
@ -29,46 +29,80 @@
|
|||||||
// Der komplette Datensatz eines Nutzers darf dann nicht importiert werden
|
// Der komplette Datensatz eines Nutzers darf dann nicht importiert werden
|
||||||
|
|
||||||
|
|
||||||
//Just for testing
|
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
class Programm {
|
|
||||||
public static void Main(string[] args)
|
|
||||||
{
|
|
||||||
Console.WriteLine("Willkommen");
|
|
||||||
Console.Write("Bitte geben Sie nun die Kundenummer ein: ");
|
|
||||||
String kundennummer = Console.ReadLine();
|
|
||||||
Console.Write("Bitte geben Sie die Datei-Parameter ein: ");
|
|
||||||
String dateiParameter = Console.ReadLine();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Überlegung mit File.Exist zu arbeiten.
|
|
||||||
/*
|
|
||||||
* using System;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using MySql.Data;
|
||||||
|
using MySql.Data.MySqlClient;
|
||||||
|
using MySqlX.XDevAPI;
|
||||||
|
using System.Data.Common;
|
||||||
|
using System.Reflection.PortableExecutable;
|
||||||
|
using System.Xml;
|
||||||
|
|
||||||
class Program
|
class Program
|
||||||
{
|
{
|
||||||
static void Main(string[] args)
|
static void Main(string[] args)
|
||||||
{
|
{
|
||||||
string filePath = "path/to/your/VARIABLE";
|
//Connection zum Server
|
||||||
|
|
||||||
if (!File.Exists(filePath))
|
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=import_export"; //ID eventuell von phpMyAdmin ziehen?
|
||||||
|
|
||||||
|
try
|
||||||
{
|
{
|
||||||
Console.WriteLine("File does not exist.");
|
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;";
|
||||||
|
//Selber eingefügt ab hier
|
||||||
|
myCommand.CommandText = @"SELECT * FROM user";
|
||||||
|
//Hier ende
|
||||||
|
// myCommand.Parameters.AddWithValue("@code", "12");
|
||||||
|
|
||||||
|
// execute the command and read the results
|
||||||
|
using MySqlDataReader myReader = myCommand.ExecuteReader();
|
||||||
|
|
||||||
|
|
||||||
|
//Hier dann den CSV Reader benutzen?
|
||||||
|
while (myReader.Read())
|
||||||
|
{
|
||||||
|
int id = myReader.GetInt32("id");
|
||||||
|
string name = myReader.GetString("firstname");
|
||||||
|
Console.WriteLine(id + " " + name);
|
||||||
|
}
|
||||||
|
|
||||||
|
myConnection.Close();
|
||||||
}
|
}
|
||||||
else
|
catch (MySql.Data.MySqlClient.MySqlException ex)
|
||||||
{
|
{
|
||||||
Console.WriteLine("File exists.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Consolen-Ausgabe und Abfrage
|
||||||
|
|
||||||
|
Console.WriteLine("Willkommen");
|
||||||
|
Console.Write("Bitte geben Sie nun die Kundenummer ein: ");
|
||||||
|
string kundennummer = Console.ReadLine();
|
||||||
|
Console.Write("Bitte geben Sie die Datei-Parameter ein: ");
|
||||||
|
string dateiBezeichnung = Console.ReadLine();
|
||||||
|
|
||||||
|
string filePath = "path/to/your/" + dateiBezeichnung; //Wo wird die CSV vor dem einlesen abgelegt? Extra Ordner dafür erstellen
|
||||||
|
|
||||||
|
//Überprüfung einbauen, ob die Datei exisitiert mit if()
|
||||||
|
|
||||||
|
//Schwierigkeit: Bei User beginnen und dann alle anderen Tabellen durch Foreign Keys verbinden/verweisen
|
||||||
|
//Procedure INSERT anschauen - Elegante Lösung
|
||||||
|
//Auto Increment beachten
|
||||||
|
|
||||||
|
//Umsetzung mit Arrays: Beginnend mit durchzählen für Länge Array, Dann unterteilung in Blöcken
|
||||||
|
//(CSV Datei einteilen vor Herr/Frau) , Dann erstellung Tabelle User, dann Andere Tabellen mit Foreign Keys verbinden
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -14,7 +14,7 @@ using System.Reflection;
|
|||||||
[assembly: System.Reflection.AssemblyCompanyAttribute("Projekt_Calcan_Conze")]
|
[assembly: System.Reflection.AssemblyCompanyAttribute("Projekt_Calcan_Conze")]
|
||||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+0156f3e3acc7bb026e8d4565aa104a54cf1d1c73")]
|
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+5be00c2e03258059442828eb121b209b9abc8ce5")]
|
||||||
[assembly: System.Reflection.AssemblyProductAttribute("Projekt_Calcan_Conze")]
|
[assembly: System.Reflection.AssemblyProductAttribute("Projekt_Calcan_Conze")]
|
||||||
[assembly: System.Reflection.AssemblyTitleAttribute("Projekt_Calcan_Conze")]
|
[assembly: System.Reflection.AssemblyTitleAttribute("Projekt_Calcan_Conze")]
|
||||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||||
|
@ -1 +1 @@
|
|||||||
fc3c2fdc48ca29aa0ea2ad5242089db27322de628b223a403b00d88519d0d64c
|
4b22627745609a314655206a5a1750317c1cb42a093f5d4808d42383331c33bf
|
||||||
|
Loading…
Reference in New Issue
Block a user