public static List <Drug> Select(string did) { OdbcConnection odbcConnection = DB.DBManager.GetOdbcConnection(); odbcConnection.Open(); string sql = "SELECT * FROM drug WHERE `D_ID` LIKE '%" + did + "%'"; OdbcCommand odbcCommand = new OdbcCommand(sql, odbcConnection); OdbcDataReader odbcDataReader = odbcCommand.ExecuteReader(CommandBehavior.CloseConnection); if (odbcDataReader.HasRows) { List <Drug> list = Drug.getList(odbcDataReader); odbcConnection.Close(); return(list); } else { odbcConnection.Close(); } return(null); }