From: Carlos G. A. <car...@te...> - 2003-09-21 18:34:49
|
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. Don't worry :), try: FbCommand myCommand = new FbCommand("SELECT * FROM GET_ALLOTMENTS_FORMATTED(?,?,?)", myConnection, myTxn); Or if you are using Firebird .NET Provider 1.5: FbCommand myCommand = new FbCommand("GET_ALLOTMENTS_FORMATTED", myConnection, myTxn); And a little advice :), ParameterDirection.Input is the default direction for new parameters, you can create input parameters as: myCommand.Parameters.Add("@ROOM_ID", FbType.Integer, "ROOM_ID").Value = 1; myCommand.Parameters.Add("@DATE_FROM", FbType.Date, "DATE_FROM").Value = "1/1/2000"; myCommand.Parameters.Add("@DATE_TO", FbType.Date, "DATE_TO").Value = "1/1/2008"; that i think it's more easy and readable but it's your choice :) -- Best regards Carlos Guzmán Álvarez Vigo-Spain |