A
andy
Hi,
I have an asp.net application and am facing a problem while closing my
datareader object. I am using Active reports for dotnet for generating
reports.
I create a datareader object in my data access layer and then pass it
to the calling function ( I know this isnt a good practice, but I cant
change this). I am using the commandbehaviour.closeconnection property
while opening the datareader. The problem occurs when the
Datareader.close() function is called, the page just hangs there and
nothing happens!. I am unable to understand why this happens. I
checked the connection state when I'm calling close , it shows that
the connection state is Open.
The code works fine on one of my development machines but hangs on two
other machines. I'm attaching the code where I'm getting a problem.
Please let me know if you can see any errors or why I'm facing this
problem.
private void rpt_Report1_ReportStart(object sender, System.EventArgs
{
try
{
ReportHelper rh=new ReportHelper();
//SQL Query
StringBuilder sbSQL=new StringBuilder();
sbSQL.Append("SELECT * from tablename");
mReader=SqlHelper.ExecuteReader(mConnString,CommandType.Text,sbSQL.ToString());
sbSQL=null;
rh=null;
}
}
private void rpt_Report1_ReportEnd(object sender, System.EventArgs
eArgs)
{
mReader.Close();
mReader=null;
}
Thanks in advance
Andy
I have an asp.net application and am facing a problem while closing my
datareader object. I am using Active reports for dotnet for generating
reports.
I create a datareader object in my data access layer and then pass it
to the calling function ( I know this isnt a good practice, but I cant
change this). I am using the commandbehaviour.closeconnection property
while opening the datareader. The problem occurs when the
Datareader.close() function is called, the page just hangs there and
nothing happens!. I am unable to understand why this happens. I
checked the connection state when I'm calling close , it shows that
the connection state is Open.
The code works fine on one of my development machines but hangs on two
other machines. I'm attaching the code where I'm getting a problem.
Please let me know if you can see any errors or why I'm facing this
problem.
private void rpt_Report1_ReportStart(object sender, System.EventArgs
{
try
{
ReportHelper rh=new ReportHelper();
//SQL Query
StringBuilder sbSQL=new StringBuilder();
sbSQL.Append("SELECT * from tablename");
mReader=SqlHelper.ExecuteReader(mConnString,CommandType.Text,sbSQL.ToString());
sbSQL=null;
rh=null;
}
}
private void rpt_Report1_ReportEnd(object sender, System.EventArgs
eArgs)
{
mReader.Close();
mReader=null;
}
Thanks in advance
Andy