public static ArrayList GetSelect() { MYsql my = new MYsql(); string sql = "select n.nNo,n.nTitle,n.nContents,m.mName,DATE_FORMAT(n.regDate, '%Y-%m-%d') as regDate,DATE_FORMAT(n.modDate, '%Y-%m-%d') as modDate from Notice as n inner join Member as m on (n.mNo = m.mNo and m.delYn = 'N') where n.delYn = 'N';"; MySqlDataReader sdr = my.Reader(sql); // string result = ""; ArrayList list = new ArrayList(); while (sdr.Read()) { Hashtable ht = new Hashtable(); for (int i = 0; i < sdr.FieldCount; i++) { //result += string.Format("{0} : {1} ", sdr.GetName(i), sdr.GetValue(i)); ht.Add(sdr.GetName(i), sdr.GetValue(i)); } //result += "\n"; list.Add(ht); } return(list); }
public static ArrayList inSelect() { MYsql my = new MYsql(); string sql = "SELECT mNo From Member WHERE mName LIKE '%최영진%';"; MySqlDataReader sdr = my.Reader(sql); // string result = ""; ArrayList list = new ArrayList(); while (sdr.Read()) { Hashtable ht = new Hashtable(); for (int i = 0; i < sdr.FieldCount; i++) { //result += string.Format("{0} : {1} ", sdr.GetName(i), sdr.GetValue(i)); ht.Add(sdr.GetName(i), sdr.GetValue(i)); } //result += "\n"; list.Add(ht); } return(list); }