-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathObject.cs
More file actions
39 lines (32 loc) · 960 Bytes
/
Object.cs
File metadata and controls
39 lines (32 loc) · 960 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DatabaseNamespace;
using MySql.Data.MySqlClient;
namespace WindowsFormsApplication1
{
class Object
{
public Database singleton = Database.getInstance();
public MySqlConnection dao;
public Object()
{
dao = singleton.db;
}
public List<string> getAllType()
{
MySqlCommand command = new MySqlCommand("SELECT name FROM object_type", dao);
using (MySqlDataReader reader = command.ExecuteReader())
{
List<string> object_type = new List<string>();
while (reader.Read())
{
for (int i = 0; i < reader.FieldCount; i++)
object_type.Add(reader.GetValue(i).ToString());
}
return object_type;
}
}
}
}