This commit is contained in:
NBTEMP\bib
2026-08-20 16:03:58 +02:00
+16
View File
@@ -1,6 +1,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.Data;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
@@ -31,6 +32,21 @@ namespace Casino
// execute the command and read the results // execute the command and read the results
using MySqlDataReader myReader = myCommand.ExecuteReader(); using MySqlDataReader myReader = myCommand.ExecuteReader();
while (myReader.Read())
{
User u = new User(myReader.GetString("name"), myReader.GetInt32("age"), myReader.GetString("passwort"))
{
ID = myReader.GetString("id"),
Name = myReader.GetString("name"),
Alter = myReader.GetInt32("age"),
Passwort = myReader.GetString("passwort"),
Geld = myReader.GetInt32("geld")
};
user.Add(u);
}
myConnection.Close(); myConnection.Close();
} }
catch (MySql.Data.MySqlClient.MySqlException ex) catch (MySql.Data.MySqlClient.MySqlException ex)