/// <summary> /// 사용자 쿼리 실행 /// </summary> public DataSet runUserQuery(string userQuery) { MicroBSC.Integration.CTL.Dac.Dac_Ctl_Common dacCtlData = new MicroBSC.Integration.CTL.Dac.Dac_Ctl_Common(); DataSet DS = dacCtlData.runUserQuery_DB(userQuery); return(DS); }
public static void SetDataFieldsX2(string query, string xField1, out ArrayList xValue1, string xField2, out ArrayList xValue2, string yField1, out ArrayList yValue1, string yField2, out ArrayList yValue2, string yField3, out ArrayList yValue3, string yField4, out ArrayList yValue4, string yField5, out ArrayList yValue5) { //SqlConnection myConnection = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["MainDB"].ConnectionString); //SqlCommand myCommand = new SqlCommand(query, myConnection); //myCommand.Connection.Open(); //SqlDataReader myReader = myCommand.ExecuteReader(); MicroBSC.Integration.CTL.Dac.Dac_Ctl_Common dacCtlCommon = new MicroBSC.Integration.CTL.Dac.Dac_Ctl_Common(); DataTable dt = dacCtlCommon.runUserQuery_DB(query).Tables[0]; xValue1 = new ArrayList(); //if(xValue2 != null) xValue2 = new ArrayList(); yValue1 = new ArrayList(); //if(yValue2 != null) yValue2 = new ArrayList(); //if(yValue3 != null) yValue3 = new ArrayList(); //if (yValue4 != null) yValue4 = new ArrayList(); //if (yValue5 != null) yValue5 = new ArrayList(); //while (myReader.Read()) //{ // xValue1.Add(myReader[xField1].ToString()); // if (xField2 != null) // xValue2.Add(myReader[xField2].ToString()); // yValue1.Add(double.Parse(myReader[yField1].ToString())); // if (yField2 != null) // yValue2.Add(double.Parse(myReader[yField2].ToString())); // if (yField3 != null) // yValue3.Add(double.Parse(myReader[yField3].ToString())); // if (yField4 != null) // yValue4.Add(double.Parse(myReader[yField4].ToString())); // if (yField5 != null) // yValue5.Add(double.Parse(myReader[yField5].ToString())); //} //myReader.Close(); //myConnection.Close(); for (int i = 0; i < dt.Rows.Count; i++) { DataRow row = dt.Rows[i]; xValue1.Add(row[xField1].ToString()); if (xField2 != null) { xValue2.Add(row[xField2].ToString()); } yValue1.Add(double.Parse(row[yField1].ToString())); if (yField2 != null) { yValue2.Add(double.Parse(row[yField2].ToString())); } if (yField3 != null) { yValue3.Add(double.Parse(row[yField3].ToString())); } if (yField4 != null) { yValue4.Add(double.Parse(row[yField4].ToString())); } if (yField5 != null) { yValue5.Add(double.Parse(row[yField5].ToString())); } } }