User datenbank verknüpft
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
@@ -31,6 +32,21 @@ namespace Casino
|
||||
// execute the command and read the results
|
||||
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();
|
||||
}
|
||||
catch (MySql.Data.MySqlClient.MySqlException ex)
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ namespace Casino
|
||||
{
|
||||
public class User
|
||||
{
|
||||
public string ID { get; }
|
||||
public string ID { get; set; }
|
||||
public string Name { get; set; }
|
||||
public int Alter { get; set; }
|
||||
public string Passwort { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user