So, I'm a a newcomer programmer working towards an undergraduate Comp Sci degree having a very little bit of experience. In searching for internship-type jobs for my program, I've observed that what I have been told by several profs -- "dealing with databases comprises 90% of modern computer science jobs" -- appears like it's really true. However, my program does not genuinely have any courses with databases until 3rd year, so I am attempting to a minimum of learn several things myself in the meantime.

I have seen hardly any on SO and also the internet generally for an individual like myself. There appear to become a lot of lessons around the mechanics of methods to read data inside a database, but little around the connected guidelines. To show things i am speaking about, and also to help get across my actual question, here's what can easily be located on the internet:

public static void Main ()
{
    using (var conn = new OdbcConnection())
    {
        var command = new OdbcCommand();
        command.Connection = conn;
        command.CommandText = "SELECT * FROM Customer WHERE id = 1";
        var dbAdapter = new OdbcDataAdapter();
        dbAdapter.SelectCommand = command;
        var results = new DataTable();
        dbAdapter.Fill(results);
    }

    // then you would do something like
    string customerName = (string) results.Rows[0]["name"]; 
}

And so on. This really is really quite simple to know but clearly filled with problems. I began by helping cover their code such as this and rapidly began saying such things as "well it appears dumb to simply have SQL everywhere, I ought to invest that inside a constants file." After which I recognized it was silly to possess individuals same lines of code everywhere and merely invest that stuff with connection objects etc in the method:

public DataTable GetTableFromDB (string sql)
{
    // code similar to first sample
}    

string getCustomerSql = String.Format(Constants.SelectAllFromCustomer, customerId);
DataTable customer = GetTableFromDB(getCustomerSql);
string customerName = (string) customer.Rows[0]["name"];

This appeared to become a large improvement. Now it's super-simple to, say, vary from an OdbcConnection for an SQLiteConnection. But that last line, being able to access the information, still appeared awkward which is still a discomfort to alter a area title (like going from "title" to "CustName" or something like that). I began reading through about using typed Data sets or custom business objects. I am still type of confused by all of the terminology, but made the decision to consider it anyway. I figure that it's stupid to depend on the shiny Database Wizard to complete all of this stuff for me personally (as with the linked articles) before I really learn what's going on, and why. And So I required a stab in internet marketing myself and began getting such things as:

public class Customer
{
    public string Name {get; set;}
    public int Id {get; set;}

    public void Populate ()
    {
        string getCustomerSql = String.Format(Constants.SelectAllFromCustomer, this.Id);
        DataTable customer = GetTableFromDB(getCustomerSql);
        this.Name = (string) customer.Rows[0]["name"]; 
    }

    public static IEnumerable<Customer> GetAll()
    {
        foreach ( ... ) { 
            // blah blah
            yield return customer;
        }
    }
}

to cover the ugly table stuff and supply some strong typing, permitting outdoors code to simply do such things as

var customer = new Customer(custId);
customer.Populate();
string customerName = customer.Name;

that is great. And when the client table changes, alterations in the code only have to happen in one location: within the Customer class.

So, in the finish of this rambling, my real question is this. Has my slow evolution of database code been pointed in the right direction? And where will i go next? This style is fine and dandy for small-ant databases, however when you will find lots of unique tables, writing out all individuals classes for every one will be a discomfort. I've learned about software that may generate that kind of code for you personally, but am type of still confused through the DAL/ORM/LINQ2SQL/etc jargon and individuals huge texts are type of overwhelming. I am searching for good quality not-extremely-complex assets that may point me within the right direction. All I'm able to find about this subject are complex articles which go way over my mind, or articles that simply demonstrate ways to use the point-and-click magicians in Visual Studio and the like. Also observe that I am searching for info on dealing with Databases in code, not info on Database design/normalization...there are many good material on that available.

Thank you for reading through this giant wall of text.