Re: making datareaders



dbahooker@xxxxxxxxxxx wrote:

Dim DR As New System.Data.SqlClient.SqlDataReader
DR = Nothing

First thing, you declare a new instance of a DataReader but then in
the next line you throw it away! The New keyword is not needed here
and you can delete the DR = Nothing line.

SetDataReader(DR, "EXEC spRootFoldersToCatalog")

While DR.Read

Assuming your stored procedure is executing, then you need to check if
DR is Nothing before you try to use it. I believe that is the problem.
Your stored procedure is not returning anything. You should use SQL
Profiler to help determine why you are not getting any data back.

.



Relevant Pages

  • Re: stored proc code always returns null?
    ... described by "but when i call this from inside another stored procedure ... >now the odd thing about this procedure, if the parameter of @tiercode is ... >declare @lastEffectiveDate as datetime ... >RetroContractCountsTierData.TierCode as TierCode from (retrocontractcounts ...
    (microsoft.public.sqlserver.programming)
  • Re: Shredding XML
    ... to determine which field values should be extracted from an XML doc ... The stored procedure works, but the process of dynamically gathering ... DECLARE keycolumns_cursor CURSOR LOCAL ... DECLARE @xPath varchar ...
    (microsoft.public.sqlserver.xml)
  • Re: ADODB.Command
    ... Try to add SET NOCOUNT ON as a very first statement ... Also declare your parameter as adParamInputOutput. ... > because the stored procedure runs another that appends tracking info, ...
    (microsoft.public.vb.database.ado)
  • RE: What stored procedures call this stored procedure?
    ... this in the wrong way - I have the ID of a stored procedure and I'm looking ... > set nocount on ... > declare @rv int ...
    (microsoft.public.sqlserver.programming)
  • Re: Performance concerns in SPs and Tables
    ... what do you call "procedural code" and "declarative code"? ... I've never heard of a memory leak problem ... > Declare as many parameters as you need to declare. ... > data into a very large table via a stored procedure, ...
    (microsoft.public.sqlserver.programming)