I’ve been looking for this question but hadn’t have no luck, I hope it isn’t repeated.
I have one abstract class.
public abstract class IFDB
{
public struct Estructura_TablaCuentasBancarias
{
public string NombreTabla;
public string NumeroDeCuenta;
public string Entidad;
public string DNIPropietario;
public Estructura_TablaCuentasBancarias(string NombreTabla, string NumeroDeCuenta, string Entidad, string DNIPropietario)
{
this.NombreTabla = NombreTabla;
this.NumeroDeCuenta = NumeroDeCuenta;
this.Entidad = Entidad;
this.DNIPropietario = DNIPropietario;
}
}
}
And the derived class:
class CntrDBSQLSRVCompac: IFDB
{
public readonly Estructura_TablaCuentasBancarias TablaCuentasBancarias =
new Estructura_TablaCuentasBancarias("CuentasBancarias", "Numero De Cuenta", "Entidad", "DNI Propietario");
In the program I have done the instance:
protected IFDB ClsCntrlDB;
...
ClsCntrlDB = new CntrDBSQLSRVCompac();
But when trying to use the estructure “TablaCuentasBancarias” it’s not on the list of possible functions/vars.
If the instance and initialization of the structure is done in the IFDB class it works perfectly but, I want to make the IFDB class an interface.
What I’m doing wrong?
Thank you.
Following code works fine for me, so maybe you have some other issue.