Sign in to follow this  
LordAsm

[.net] C# Class Library problem

Recommended Posts

Hi I'm trying to make a class library for some functions I made using ADO.NET, which are distributed in a class named bd and an interface named persistencia, all in the same namespace called bancodados. Okay, I've built it and generated an DLL, very fine, but when I add the reference to my DLL in some other C# project, the object browser do not show my namespace nor my classes, and I cannot access them. What I'm doing wrong? These are my code interface and class declaration, along with all the namespaces I'm using.. interface bancodados
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.Odbc;

namespace bancodados {
  interface iPersistencia {
    string SQL { get; set; }
    string Filtro { get; set; }
    string Servidor { get; set; }
    string Database { get; set; }
    string Login { get; set; }
    string Senha { get; set; }
    int UltimoID { get; }
    TipoBanco Tipo { get; set; }
    bool Persistente { get; set; }
    ArrayList Registros { get; }
    int RegistrosAfetados { get; }

    int ProximoID(string tabela);
    bool Conectar();
    void Desconectar();

    bool ExecutarSQL();
    bool ExecutarSQL(string sql);
  }
}



class bd
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.Odbc;

namespace bancodados
{
    enum TipoBanco {
        SQLServer,MySQL,PostgreSQL,Oracle,Interbase,Access,Excel,Text
    }
    class bd : iPersistencia
    {

.
.
.

    }



Ty all, see ya -Roger-

Share this post


Link to post
Share on other sites
You need to make them public. By default, namespace level declarations have "internal" access, so they can only be accessed from within the assembly. Declare your interface, class and enum as public and then you should be able to use them from another assembly.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this