From: Mike N. <mi...@ta...> - 2003-09-21 15:17:08
|
Hello I have a stored procedure that returns a recordset. Works fine when I call it from IBExpert, but when I call it from .NET I am only getting one row returned. I am not sure I am using the correct syntax to call a stored proc that returns a recordset. I'm displaying it in a grid, and my test code is below. I'd appreciate it if someone could point me in the right direction here.. I'm new to .NET and only have a bit of firebird experience. Regards Mike ---- FbConnection myConnection = new FbConnection(connectionString); myConnection.Open(); FbTransaction myTxn = myConnection.BeginTransaction(); FbCommand myCommand = new FbCommand("EXECUTE PROCEDURE GET_ALLOTMENTS_FORMATTED(?,?,?)", myConnection, myTxn); myCommand.CommandType = CommandType.StoredProcedure; myCommand.Parameters.Add("@ROOM_ID", FbType.Integer, "ROOM_ID").Direction = ParameterDirection.Input; myCommand.Parameters.Add("@DATE_FROM", FbType.Date, "DATE_FROM").Direction = ParameterDirection.Input; myCommand.Parameters.Add("@DATE_TO", FbType.Date, "DATE_TO").Direction = ParameterDirection.Input; myCommand.Parameters[0].Value = 1; myCommand.Parameters[1].Value = "1/1/2000"; myCommand.Parameters[2].Value = "1/1/2008"; FbDataReader myReader; myReader = myCommand.ExecuteReader(CommandBehavior.CloseConnection); DataGrid1.DataSource = myReader; DataGrid1.DataBind(); myReader.Dispose(); |