I am in the preparation stages of writing my first real program. I've designed a set of tables to store my financial data. I know
1) what data goes where in the tables
2) what relationships exist between tables and fields
3) what queries are needed
4) what the forms should look like to write data to the tables
5) what output I need and how it should be organized
I've decided on C#, with WPF for the GUI, and a SQL database for the data. If I understand correctly I'll be needing ADO.NET to interface with the SQL db. The problem for me is that right now I am only familiar with writing non-GUI C++ using text files (or the keyboard) for input.
I'm not desiring to become a programmer with varied and marketable skills, so I'd rather avoid spending time learning things that won't apply to this project. I'm looking for the most direct route from here to a useful working (and maintainable) program.
So that's the situation I need help with. Please let me know if I left out anything relevant.
My question is, what are the steps I need to take from here to get it done?
Thanks for your help.
My suggestion to you is to first write your first prototype as a console/text program under the platform of choice. When you've got the input and output the way you want it - then ask again for refactoring help in getting the UI the way you want it. You can also get your db queries easily tested and you're using your existing skills more efficiently earlier on to get the functionality right but with a limited UI.
Your console program will then also be a verification that the GUI version of your program is working as expected.
Edit: Here is a simple program that reads a value from the database and puts it on the screen.
using System;
using System.Data;
using System.Data.SqlClient;
class Program
{
static void Main()
{
using (SqlConnection connection = new SqlConnection("Data Source=server;database=mydb; Integrated Security=SSPI"))
{
SqlCommand command = connection.CreateCommand();
command.CommandText = "SELECT CategoryID, CategoryName FROM dbo.Categories;";
try
{
connection.Open();
SqlDataReader reader = command.ExecuteReader();
// process each row one at a time
while (reader.Read())
{
// reader contains the row (reader[0] is first column, etc)
Console.WriteLine("\t{0}\t{1}", reader[0], reader[1]);
}
reader.Close();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
}
}
Use this (and the link from where I got another version of this) to help you through through ado.net initially. As an experience programmer you can see that if you follow this model you can create common functions that return data based on passed in queries. When you want to get tables of data back instead of simple values, I'd suggest moving from ExecuteReader to other data functions functions.
N.B. Generally I wouldn't suggest you start here - I'd suggest fluent NHbernate but that is bit more complex for a beginner and would be better after you understand the relationship your code (in .net) has to the DB and the data therein.
Also jsut had a thought. If you want to use another technology rather that SqlClient you can use Linq2Sql. Watch this video to see if its helpful.. In fact there are some very useful free videos on DimeCasts.net.