This question is locked. New answers and comments are not allowed.
Developed an abstract class for db connections, i want to use these class in a code step, but logically i can't make an instance of these class, so, in my abstract class inherited from BaseWebAiiTest and then inherited from my abstract class in the main class of my code behind.
For example:
My Abstrac Class
In my codebehind file instead of
I wrote
For example:
My Abstrac Class
public
abstract
class
ConDB : BaseWebAiiTest
{
private
SqlConnection _conn;
private
SqlCommand _command;
private
bool
disposed =
false
;
public
ConDB(
string
nameConn =
"Conn"
)
{
this
._conn =
new
SqlConnection(ConfigurationManager.AppSettings[nameConn].ToString());
this
._command =
this
._conn.CreateCommand();
this
._command.CommandType = System.Data.CommandType.StoredProcedure;
}
public
void
ExecuteNoQuery(
string
spName, SqlParameter[] parameters)
{
this
._command.CommandType = System.Data.CommandType.StoredProcedure;
this
._command.CommandText = spName;
this
._command.Parameters.Clear();
this
._command.Parameters.AddRange(parameters);
if
(
this
._conn.State != ConnectionState.Open)
{
this
._conn.Open();
}
this
._command.ExecuteNonQuery();
this
._conn.Close();
}
public
class
AltamasEstablecerContraseña : BaseWebAiiTest
public
class
AltamasEstablecerContraseña : ConDB
So, When i try to run the test appear the error:
Please make sure your test code behind is compiled with your latest changes
And all my codebehind files are compiled sucessfully
Please help me, thanks in advance!!