G
Guest
I am using the PetShop example's ExecuteReader function:
public static SqlDataReader ExecuteReader(string connectionString,
CommandType cmdType, string cmdText, params SqlParameter[] commandParameters)
{....}
However, I alwasy get the following exception:
Outter exception:
The type initializer for threw an exception.
Inner exception:
Object reference not set to an instance of an object.
One of the calling is:
SqlDataReader reader =
SqlHelper.ExecuteReader(SqlHelper.ConnectionStringLocalTransaction,
CommandType.Text, SQL_SELECT_EVENTS_BETWEEN_DATES, null)
Which SqlHelper.ConnectionStringLocalTransaction has a valid connection
string, CommandType.Text is built-in type, SQL_SELECT_EVENTS_BETWEEN_DATES is
a valid string constant SQL statement. I tried to pass valid parameters too
and got the same exception?
public static SqlDataReader ExecuteReader(string connectionString,
CommandType cmdType, string cmdText, params SqlParameter[] commandParameters)
{....}
However, I alwasy get the following exception:
Outter exception:
The type initializer for threw an exception.
Inner exception:
Object reference not set to an instance of an object.
One of the calling is:
SqlDataReader reader =
SqlHelper.ExecuteReader(SqlHelper.ConnectionStringLocalTransaction,
CommandType.Text, SQL_SELECT_EVENTS_BETWEEN_DATES, null)
Which SqlHelper.ConnectionStringLocalTransaction has a valid connection
string, CommandType.Text is built-in type, SQL_SELECT_EVENTS_BETWEEN_DATES is
a valid string constant SQL statement. I tried to pass valid parameters too
and got the same exception?