예제 #1
0
 public static UserData[] LoadAll(MySqlConnection Connection)
 {
     Contract.Requires(Connection != null, "Connection is null.");
     MySqlDataReader reader = new MySqlCommand(loadAllQuery, Connection).ExecuteReader();
     List<UserData> r = new List<UserData>();
     object[] row = new object[5];
     int count;
     while (reader.Read())
     {
         count = reader.GetValues(row);
         r.Add(new UserData()
             {
                 _name = (string)row[0],
                 _id = (ulong)row[1],
                 _pass = (string)row[2],
                 _friendlyName = (string)row[3],
                 _gold = (uint)row[5]
             });
     }
     return r.ToArray();
 }