Hi there, i would like to find out what the hell is wrong here
/// <summary>
/// Get a single integer value
/// </summary>
/// <param name="sql">The sql query used to retreive a result set</param>
/// <returns>The value of the first column in the first row of the result set as an integer</returns>
public virtual int GetSimpleInteger( string sql )
{
SqlCommand comm = new SqlCommand( sql, GetConnectionObject() );
try
{
// Reset the error object
ClearError();
return (Int32)comm.ExecuteScalar(); <------- Error here
}
catch( SqlException ex )
{
SetError( ex );
return -1;
}
}
now the funny thing is this worked perfectly until today, i just switched my PC on and built the project straight, now also i cannot connect to SQL either...
I get this error ExecuteScalar requires an open and available Connection. The connection's current state is closed.
PLEASEEEEEEEEEEEEE HELP, this is very urgent, im on deadline
Thanks