From: Alan M. <al...@me...> - 2003-12-01 01:55:07
|
you're using a selectable procedure so use SELECT * from syntax not execute > -----Original Message----- > From: fir...@li... > [mailto:fir...@li...]On Behalf Of > Mark S. Maglana > Sent: Monday, 1 December 2003 11:57 AM > To: fir...@li... > Subject: [Firebird-net-provider] DataReader always returns one record > > > Hello, > > I'm trying to retrieve a table of users using the following stored proc: > ---------------------- > CREATE PROCEDURE SP_BROWSE_USERS > RETURNS ( > USER_ID VARCHAR(38), > SSS VARCHAR(256), > NAME_FIRST VARCHAR(50), > NAME_MIDDLE VARCHAR(50), > NAME_LAST VARCHAR(50), > NAME_USER VARCHAR(16), > IS_DISABLED CHAR(1)) > AS > begin > for select USER_ID, SSS, NAME_FIRST, NAME_MIDDLE, NAME_LAST, > NAME_USER, IS_DISABLED > from USERS > into :USER_ID, :SSS, :NAME_FIRST, :NAME_MIDDLE, :NAME_LAST, > :NAME_USER, :IS_DISABLED > do > suspend; > end > -------------------------------------------------------- > > Now when I tried this in the database, it works just fine. Returns all the > records in the table, however, when I use the firebird .net provider using > the following code, I always get a single record. > > --------------------------------------- > > objConn.Open(); > > FbTransaction objTrans = objConn.BeginTransaction(); > > // strCommandText contains the > // "EXECUTE PROCEDURE SP_BROWSE_USERS.." string > FbCommand objCommand = new FbCommand(strCommandText, this.GetConnection(), > objTrans); > > objCommand.CommandType = CommandType.StoredProcedure; > FbDataReader objDR = objCommand.ExecuteReader(); > > ----------------------------------- > > That is, once I call the objDR.Read() method, I only get a true > value at the > first call. Subsequent call always return false, hence I only get > one record > every time. > > Any ideas? > > Mark > > > ------------------------------------------------------- > This SF.net email is sponsored by: SF.net Giveback Program. > Does SourceForge.net help you be more productive? Does it > help you create better code? SHARE THE LOVE, and help us help > YOU! Click Here: http://sourceforge.net/donate/ > _______________________________________________ > Firebird-net-provider mailing list > Fir...@li... > https://lists.sourceforge.net/lists/listinfo/firebird-net-provider > > |