public List<Dictionary<string, object>> GetList(String sql, String[] properties)
{
int prosLength = properties.Length;
SqlCommand command = new SqlCommand(sql);
SqlConnection sqlConn = getConnection();
command.Connection = sqlConn;
if (sqlConn.State != ConnectionState.Open)
{
sqlConn.Open();
}
SqlDataReader read = command.ExecuteReader();
List<Dictionary<string, object>> list = new List<Dictionary<string, object>>();
Dictionary<string, object> map = null;
while (read.Read())
{
map = new Dictionary<string, object>();
for (int i = 0; i < prosLength; i++)
{
map.Add(properties, read[properties]);
}
list.Add(map);
map = null;
}
read.Close();
sqlConn.Close();
return list;
}
string[] prototype_96 = new string[] { "clientID", "payBackNum" };
string sql_96 = "SELECT ClientID, SUM (PaymentMoney) payBackNum FROM T_C_ClientPayment WHERE PaymentDate BETWEEN '" + start + "' AND '" + end + "' GROUP BY ClientID";
List<Dictionary<string, object>> list5 = basedao.GetList(sql_96, prototype_96);
for (int i = 0; i < list.Count; i++) //这里的count有200多
{
sql1="XXXXXXX"
GetList(sql1,prototpye1);
sql2="XXXXXXX"
GetList(sql2,prototpye1);
sql3="XXXXXXX"
GetList(sql3,prototpye1);
sql4="XXXXXXX"
GetList(sql4,prototpye1);
}
欢迎光临 重工电子论坛 (http://cqutlab.cn/) | Powered by Discuz! X3.1 |