public static DataSet QuerySqls( List<string> listSelectSql, string strConn)
{
ConnectionStringSettings connStrSetting = GetConnStrSetting(strConn);
using (OracleConnection conn = new OracleConnection(connStrSetting.ConnectionString))
{
OracleCommand cmd = new OracleCommand();
StringBuilder strSql = new StringBuilder();
strSql.Append("begin ");
for (int i = 0; i < listSelectSql.Count; i++)
{
string paraName = "p_cursor_" + i;
strSql.AppendFormat("open :{0} for {1}; ", paraName, listSelectSql[i]);
cmd.Parameters.Add(paraName, OracleDbType.RefCursor, DBNull.Value, ParameterDirection.Output);
}
strSql.Append("end;");
cmd.Connection = conn;
cmd.CommandText = strSql.ToString();
OracleDataAdapter oda = new OracleDataAdapter();
oda.SelectCommand = cmd;
conn.Open();
DataSet ds = new DataSet();
oda.Fill(ds);
conn.Close();
return ds;
}
}