How to use C # Windows Forms with Firebird and Object Orientation? [closed]

1

I recently learned a little object orientation and c # . But I am trying to create an application that is developed in C # windows forms , with firebird and object-oriented database. But what is the right way to do it? How do I connect my bank to my application and how do I interact with the visual studio interface? I have also seen that it is possible to use App.Config as in sql , but how do I do this?

For example, I currently have the repostory of a class and inside it I create events like add, change and etc, usually I do this:

public void Adicionar(Pais pais)
{
    string sql = "INSERT INTO PAIS (PAINOME) VALUES('" + pais.PaiNome+ ")";

    Conexao.Active(true);
    FbCommand cmd = new FbCommand(sql, Conexao.fbCnn);
    cmd.ExecuteNonQuery();
    Conexao.Active(false);
}

This way every time I make some changes in the classes I have to change in all the repositories, for example, if I add a new field to the country I would have to change all the sql strings by adding the new field. Is this the right way to do it? Can I make it more automatic or not?

Thank you!

    
asked by anonymous 12.08.2015 / 21:59

1 answer

-1

Legal your interest in programming.

However, my tip is: try to do things one step at a time. Learn how to connect through C #, then learn how to use Windows Forms, then try connecting to Firebird.

I understand that the will to learn and to do something alone is great. But things happen in sequence.

Below are some tutorials in Portuguese, nothing hard to find on Google, and nothing less than what you'll find here, your question being so generic.

link

link

link

    
12.08.2015 / 22:30