Click here to Skip to main content
16,017,857 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Program execute by recursion function then it's show .... in this part of block
C#
public static DataTable ExecuteSelectCommand(DbCommand command)
{
    DataTable table;
    // The DataTable to be returned
    
    // Execute the command, making sure the connection gets closed in the
    // end
    try
    {
        // Open the data connection
        command.Connection.Open();
        // Execute the command and save the results in a DataTable
        DbDataReader reader = command.ExecuteReader();
        table = new DataTable();
        table.Load(reader);
        // Close the reader
        reader.Close();
    }
    catch (Exception ex)
    {
        utilities.LogError(ex);
        throw;  
    }
    finally
    {
        // Close the connection
        command.Connection.Close();
    }
    return table;
}



[Edit member="Tadit"]
Added pre tags.
[/Edit]
Posted
v2
Comments
Ankur\m/ 27-Nov-14 5:44am    
How many rows does your query return? Can you also post complete stacktrace?
Amresh Bahadur Singh 27-Nov-14 5:48am    
Both case return multiple rows or no one records
Sinisa Hajnal 27-Nov-14 6:02am    
Recursion block...please show that part. This part is simply the one executed one too many times. You have a recursion that goes "too deep", that is, it doesn't have proper final return.
Amresh Bahadur Singh 27-Nov-14 6:13am    
Global.aspx
------------
void Application_Start(object sender, EventArgs e)
{

Recurssion();

}

public void Recurssion( )
{

CallFuctionForBatchProcess_Amr objo = new CallFuctionForBatchProcess_Amr();

objo.btndone_OnClick();

Recurssion();

}
Bernhard Hiller 27-Nov-14 6:02am    
"Program execute by recursion function" - that is the problem!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900