Avançar para o conteúdo principal

Mensagens

A mostrar mensagens de abril, 2015

Saving pictures to an Access database

What is the best method for storing images in a server? That's a discussion that we will never see the end. In my opinion, has in everything in life, it depends. But in this post we will not contribute to that dilemma. The objective of this post is to show how to store the pictures in an Access database. We start by creating a new project in VS 2013. Next, we create a class that will manage the database. In this class we will need a reference to a DLL that is responsible for creating the database file. In the Reference Manager with search in the COM section.    Back in the class with add a namespace: using ADOX; Now let's add three properties to the class: the path to the database file, a connection string and an object to make the connection with the database. class BaseDados     {         string caminhoBD;         string strLigacao;         OleDbConnection ligacaoBD;     }  The connection object needs another namespace: using System.Data.OleDb; In the constructor of the class