G
Guest
Hi,
I have a created an application using web services and sql server. On my dev
server, it's working, but when I switched to the production server with
heavier traffic (100 users at the same time), I got this error:
System.NullReferenceException: Object reference not set to an instance of an
object.
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
at System.Data.SqlClient.SqlCommand.ExecuteReader()
at LiveSnapDotNet.server.database.BDSqlServer.executeSQLQuery(SqlCommand
sqlCommand)
Here's my code:
/* Opens a connection, sets the connection with new SqlConnection() */
openConnection();
if (connection != null)
{
try
{
/* Sets the command properties */
sqlCommand.Connection = connection;
sqlCommand.CommandType = CommandType.StoredProcedure;
sqlCommand.CommandText = "sp_getUsers"
/* Executes it */
resultSet = sqlCommand.ExecuteReader();
}
catch(Exception e)
{
...
}
Why this error keeps occuring when there's many users? DO I have to increase
the connection pool max size?
Thanks for any help.
Stephane
I have a created an application using web services and sql server. On my dev
server, it's working, but when I switched to the production server with
heavier traffic (100 users at the same time), I got this error:
System.NullReferenceException: Object reference not set to an instance of an
object.
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
at System.Data.SqlClient.SqlCommand.ExecuteReader()
at LiveSnapDotNet.server.database.BDSqlServer.executeSQLQuery(SqlCommand
sqlCommand)
Here's my code:
/* Opens a connection, sets the connection with new SqlConnection() */
openConnection();
if (connection != null)
{
try
{
/* Sets the command properties */
sqlCommand.Connection = connection;
sqlCommand.CommandType = CommandType.StoredProcedure;
sqlCommand.CommandText = "sp_getUsers"
/* Executes it */
resultSet = sqlCommand.ExecuteReader();
}
catch(Exception e)
{
...
}
Why this error keeps occuring when there's many users? DO I have to increase
the connection pool max size?
Thanks for any help.
Stephane