日期:2014-05-18  浏览次数:20426 次

谁能帮我看一下getRow这个类有什么问题吗。
public static OracleDataReader getRow(string sql)
  {
  try
  {
  OracleConnection con = createCon();
  con.Open();
  OracleCommand com = new OracleCommand(sql, con);
  return com.ExecuteReader();
  }
  catch
  {
  return null;
  }
  finally
  {
  con.Close();
  }
  }

------解决方案--------------------
com.ExecuteReader()这里没关闭吧
con放try之前,不然,后面不识别
con.close()后能不能得到datareader?
------解决方案--------------------
探讨
com.ExecuteReader()这里没关闭吧
con放try之前,不然,后面不识别
con.close()后能不能得到datareader?