Gday, im fairly new to C# and ado.net
I have a stored procedure in SQL Server 2005 that returns a cursor, as below;
CREATE
(
@ModuleCursor CURSOR VARYING OUTPUT
)
AS
SET NOCOUNT ON;
SET @ModuleCursor = CURSOR
FORWARD_ONLY STATIC FOR
SELECT uid, name, active
FROM BIM.module;
OPEN @ModuleCursor;
GO
In C# I want to get this cursors resultset and use it, so I am thinking its something like this;
Question 1) How do I load the cursor into ADO.Net Reader
Question 2) Do I need to reference index of colums, cant I use column names ?
private void LoadModules(ref SqlConnection Connection)
{
SqlCommand command = Connection.CreateCommand();
command.CommandText = "BIM.dbo.SP_GetModules";
command.CommandType = CommandType.StoredProcedure;
//How do I load the cursor into ADO.Net Reader ?
amodule =
}