Microsoft Access: Reading data from stored procedure with a cursor into datalist

  • merdaadk / 102 / Wed, 24 Feb 2010 19:44:00 GMT / Comments (0)
  • I am trying to read multiple rows of data produced by a SP (that uses a cursor) into my ASP.NET/C# based web form data lists:
    Here is y sp code:

    create proc getTransList
    as begin
    declare ...l_transType int,
    ...l_transCustomerNoint,
    ...l_transAmountdecimal(16,0)
    declare cs cursor for
    select top 10 transType, transCustomerNo, transAmount from transList
    open cs
    fetch next from cs into
    ...l_transType,...l_transCustomerNo, ...l_transAmount
    while ......fetch_status = 0
    begin
    select ...l_transType + 2 as transType,
    ...l_transCustomerNo + 2 as transCustomerNo,
    ...l_transAmount as transAmount
    fetch next from cs into
    ...l_transType,...l_transCustomerNo, ...l_transAmount
    end
    close cs
    deallocate cs
    end

    When this proc is run in QA, I get TEN rows back. But when I call it from my .NET project, I only get the FIRST row back. Now if I use the select statement directly from my .NET project, I do get the ten rows. I do have to use the SP to bring in data from other tables.

    Does anyone know how to do this?

    Thanks

  • Keywords:

    reading, data, stored, procedure, cursor, datalist, microsoft, access

  • http://www.edevs.com/ms-access-database/379/«« Last Thread - Next Thread »»