李阳_TickTock 发表于 2012-9-28 20:22
问题在 DBHelper 中,发来瞧瞧
public static SqlDataReader ExecuteReader(string sql, params SqlParameter[] param)
{
SqlConnection conn = new SqlConnection(connString);
SqlCommand cmd = new SqlCommand(sql, conn);
if (param != null && param.Length > 0)
{
cmd.Parameters.AddRange(param);
}
conn.Open();
SqlDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
return dr;
}
public static SqlDataReader ExecuteReader(string sql)
{
return ExecuteReader(sql, null);
} |