private void Execute(DbConnectionInfoItem connectionInfo, string query) { var connectionString = ConnectionStringMaker.Make(connectionInfo.ConnectionIp, connectionInfo.ConnectionDatabase, connectionInfo.ConnectionId, connectionInfo.ConnectionPassword); var cod = CODCreator.GetCOD(connectionString); var executeQuery = new ListQuery <NameValueItem> { Query = query }; try { var result = cod.Query(executeQuery); connectionInfo.Status = "완료"; var sb = new StringBuilder(); if (result.Count() > 0) { var tdic = result[0].GetDic(); var keys = tdic.Keys; sb.AppendLine(string.Join("|", tdic.Keys)); result.ForEach(t => { sb.AppendLine(string.Join("|", keys.Select(k => t.GetString(k)))); }); } connectionInfo.Message = sb.ToString(); } catch (Exception ex) { connectionInfo.Status = "오류"; connectionInfo.Message = ex.Message; } }
public void GetCODTest() { CODCreator = new CODCreator(); string conn = "testConnection"; var result = CODCreator.GetCOD(conn); var cod = (CommonObjectDao)result; Assert.AreEqual(cod.AdoTemplate.DbProvider.ConnectionString, conn); }