From: NHibernate J. <mik...@us...> - 2006-11-14 17:03:32
|
[ http://jira.nhibernate.org/browse/NH-793?page=comments#action_14399 ] dstefanov commented on NH-793: ------------------------------ // to reproduce the bug use this code: try { string strConn = "Data Source=.;Initial catalog=Northwind;Persist Security Info=False;Integrated Security=SSPI;Connect Timeout=30"; SqlConnection conn = new SqlConnection( strConn ); conn.Open(); SqlCommand cmd = conn.CreateCommand(); cmd.CommandText = "SELECT * FROM ORDERS WHERE OrderID is null"; // the result set has no rows (0 rows) NHybridDataReader reader = new NHybridDataReader( cmd.ExecuteReader() ); reader.Read(); reader.ReadIntoMemory(); } catch ( Exception ex ) { Debug.WriteLine(ex); } > NHybridDataReader.ReadIntoMemory fails when the result is 0 records. "Invalid attempt to read when no data is present". > ----------------------------------------------------------------------------------------------------------------------- > > Key: NH-793 > URL: http://jira.nhibernate.org/browse/NH-793 > Project: NHibernate > Type: Bug > Components: Core > Versions: 1.0.2, 1.0.3 > Reporter: dstefanov > Priority: Critical > > public bool Read() > { > // DS 6/30/06 - If the result is 0 records the read will always return false > // and the _isMidstream should be false so we don't attempt to read from the > // reader when we do ReadIntoMemory. We were getting an error > // "Invalid attempt to read when no data is present" when trying to get data > // from the reader is such cases. > // > //_isMidstream = true; > //return _reader.Read(); > // > _isMidstream = _reader.Read(); > return _isMidstream; > } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.nhibernate.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |