G
Gregor
Hi,
I am using the SQL data reader to access SQL2000. I am opening the
connection and executing the reader then closing reader and connection.
There is an example code:
SqlDataReader sqlReader = null;
tring storedprocName = "procName";
SqlConnection sqlConn = new SqlConnection(connString);
try
{
SqlCommand sqlCmd = new SqlCommand(storedprocName);
sqlCmd.CommandType = CommandType.StoredProcedure;
sqlCmd.Parameters.Add("@someParam", someVal);
sqlCmd.Connection = sqlConn;
sqlConn.Open();
sqlReader = sqlCmd.ExecuteReader();
while (sqlReader.Read())
{
xmlFactData = sqlReader.GetString(0);
}
}
catch(Exception ex)
{
Logger.AddMessage("Error ........... ", ex);
}
finally
{
sqlReader.Close();
sqlConn.Close();
}
Closed.,System.Data." A couple of time I had got errors like:
"Internal connection fatal error.,System.Data."
Any idea what is going on? I have SP2 installed on .Net Framework. The
most strange thing is that this behaviour is completely
nondeterministic. It sometimes happens but generally works fine and
error is difficult to reproduce.
Regards:
Greg
I am using the SQL data reader to access SQL2000. I am opening the
connection and executing the reader then closing reader and connection.
There is an example code:
SqlDataReader sqlReader = null;
tring storedprocName = "procName";
SqlConnection sqlConn = new SqlConnection(connString);
try
{
SqlCommand sqlCmd = new SqlCommand(storedprocName);
sqlCmd.CommandType = CommandType.StoredProcedure;
sqlCmd.Parameters.Add("@someParam", someVal);
sqlCmd.Connection = sqlConn;
sqlConn.Open();
sqlReader = sqlCmd.ExecuteReader();
while (sqlReader.Read())
{
xmlFactData = sqlReader.GetString(0);
}
}
catch(Exception ex)
{
Logger.AddMessage("Error ........... ", ex);
}
finally
{
sqlReader.Close();
sqlConn.Close();
}
open and available Connection. The connection's current state isFrom time to time I receive errors like: "ExecuteReader requires an
Closed.,System.Data." A couple of time I had got errors like:
"Internal connection fatal error.,System.Data."
Any idea what is going on? I have SP2 installed on .Net Framework. The
most strange thing is that this behaviour is completely
nondeterministic. It sometimes happens but generally works fine and
error is difficult to reproduce.
Regards:
Greg