2

Okay, I'm biting the bullet and deciding to get into the whole Microsoft/C#/.NET culture and I'm going to do this by putting together a simple (hah!) application.

It will basically be an application in which I want to store images and associate with them other optional things.

It must be able to import images from the filesystem (and hopefully camera/scanner) then allow the user to add text, audio and other information.

I plan to store the images and auxillary information into a database. What the application will do with said data isn't important (yet).

Keep in mind I know absolutely nothing about C# or .NET although, as an old codger, I know a great deal about many other things and will regale/bore you with stories and anecdotes until you quietly slip away :-)

What are the first steps to take in developing such an application? I've already set out UI layouts and likely process flows although it may be that the development environment dictates changes.

Development environment is currently XP SP3 + VS2008 (though I can upgrade if absolutely necessary).

What should I be looking at as the first step? Are there any gotchas I should be looking out for?

paxdiablo
  • 854,327
  • 234
  • 1,573
  • 1,953
  • 3
    You already haev 400 upvotes from the C# tag - I'd imagine you're set. – Matt Mitchell Jun 09 '10 at 06:38
  • 2
    That surprises me a great deal. I suspect most of those must be combined C#/C/C++ questions or more generic ones. ... Actually, just checked the top five and the "generic" reason seems to be the case for all of them, so I suspect that's it. I couldn't tell the difference between C# and a bar of soap :-) – paxdiablo Jun 09 '10 at 07:01

7 Answers7

2

Just a couple of pointers, it would be easy to overwhelm you as you are just starting with this tech stack. First step, use SQLServer 2008 Express, it has better ability to deal with image data (images can be saved directly to the filesystem, but they are still in a table).

Apart from that, you can design your screen with the GUI, and then hook the bits up one by one to your retreived data. Create a new Windows Forms app, or a WPF one, and start from there (i'm assuming that you know about the toolbox window and just dragging components on to the designer and setting their properties in the Properties window).

slugster
  • 49,403
  • 14
  • 95
  • 145
  • Possibly bad assumption. I haven't even loaded VS yet :-) But I suspect I'll be able to pick it up reasonably quickly - I'm not a stranger to forms-based designers, assuming it's at least a _little_ like VB6. – paxdiablo Jun 09 '10 at 07:03
  • One question, are there royalties for distributing SQLServer with an app? In terms of drivers, I mean, not the product itself. – paxdiablo Jun 09 '10 at 07:09
  • The drivers are part of the .NET framework but having an embedded instance of SQL server is something you'd have to look into and might lead you to another database solution. Fortunately C# code samples are pretty easy to come by. – Matt Mitchell Jun 09 '10 at 07:41
  • @pax, there are a lot of parallels between windows forms and old school VB. WPF is a different kettle of fish though, but once you get your head around it you will like it, and it is way more pretty than VB! – slugster Jun 09 '10 at 10:57
2

Have you decided for win forms or WPF? I've been doing win forms for the past 4 years and WPF was a great discovery for me, with the flexibility it affords. It might be fitted for your application and the different types of content you'll want to add and give you a flexibility that win forms can't give.

As for actually developing, I think loading images from the disk would be the first step, showing them in the UI and getting user input for them - you would get to work with the different objects and see how the framework handles things.

A tutorial about the field validation I mentioned in my comment is here - haven't done it, but something similar. You can also see the xaml code paired with the C# code there.

After looking for the differences between win forms and WPF I found that there are a few win forms controls that are missing from WPF. More on that on MSDN (compariosn chart) and a post from March with a more detailed chart.

It's also worth mentioning that you can include win forms controls in WPF applications and vice versa, but there are some limitations.

Rox
  • 1,985
  • 12
  • 19
  • If you're saying WPF is a lot easier, that's probably the path I'll take. It's not an application that'll need a lot of under-the-cover power so anything that speeds time-to-market will be good. Your second point is also apt - I have the first three or four agile releases mapped out in that sort of way already. – paxdiablo Jun 09 '10 at 07:07
  • It's very xml like in the editing, and if you're starting from scratch in the .NET framework, it's well worth the effort. After reading about it and doing fun stuff with it, I wish I could use for work development, too. A great example is the user input validation and the way it can be automatically and elegantly handled as opposed to win forms where visual hints for the user aren't included. – Rox Jun 09 '10 at 07:14
1

If you're looking win forms you're going to have drag-and-drop UI pretty easily.

If you want to use a database than you're probably going to find MS-SQL the easiest to cooperate with. Look up LINQ-2-SQL, it lets you access your database through an object layer by simply dragging your tables onto a pane.

Fun things to use: extension methods, partial classes, LINQ (query any collection with inline lambdas) and even class/method attributes.

Matt Mitchell
  • 40,943
  • 35
  • 118
  • 185
  • 1
    Personally, seeing as he's just starting with C#/.NET I would skip WinForms and dive straight into WPF. But I'm sure you may disagree! – Grokys Jun 09 '10 at 06:38
  • Wouldn't disagree at all - just haven't used WPF and assumed it was one of those enterprisey convoluted things from the peripheral noise I read about it. Sounds like I could be pleasantly surprised. – Matt Mitchell Jun 09 '10 at 06:40
  • Lambdas, they're very wooly district attorneys, right? :-) Actually, I haven't made a decision between WinForms and WPF, I'm at the stage where I don't even understand the distinction yet. One more thing for me to investigate. – paxdiablo Jun 09 '10 at 07:05
  • @paxdiablo: I've done only very very simple lambda and LINQ stuff but I found it great for the query like structure. So instead of doing a for with checks on an array, you say select the items that have this and you're done. Again, I'm doing only simple stuff for now, but it's a great trick. – Rox Jun 09 '10 at 07:19
  • WPF looks a lot nicer from what I see. I'm not sure if you can get nice event bound drag-and-drop like win forms though? – Matt Mitchell Jun 09 '10 at 07:39
  • Well actually Graphain, I've written a library for WPF drag/drop: http://code.google.com/p/gong-wpf-dragdrop/ which I feel makes it *easier* than WinForms drag/dop, especially if you're using the MVVM pattern. – Grokys Jun 12 '10 at 09:45
  • Nice Groky - I'll have to look at this in the future – Matt Mitchell Jun 14 '10 at 13:00
1

My $0,02:

a) Get to know the platform a bit, types, collections, events/delegates(/lambdas), etc etc

b) Dive into WPF

c) Learn about database connectivity (LINQ2SQL or NHibernate (or ....)

d) Learn about the MVVM pattern to get to deliver solid wpf applications, doing so forces you to dive deeper into the workings of WPF (routed commands, tunneling/bubbleing etc)

e) Learn more about patterns to get a more solid grasp of OO (this: http://www.amazon.com/Design-Patterns-Explained-Perspective-Object-Oriented/dp/0321247140/ref=sr_1_1?ie=UTF8&s=books&qid=1276066663&sr=8-1 is an absolute pearl for that)

f) etc

Oxymoron
  • 1,382
  • 4
  • 20
  • 40
  • Thanks. Types and collections I don't think will cause much hassle, coming from a Java b/grnd. Similarly WPF if it's relatively intuituve. Lambdas and LINQ will require some further education on my part. – paxdiablo Jun 09 '10 at 07:11
1

If you aren't too desperate to get your hands dirty straight away I'd suggest this book: CLR via C#.

It is written for those with programming experience on platforms other than .Net and provides a clear and comprehensive explanation of C# and how it runs on the .NET CLR.

By reading this initially you might avoid writing some of the poorly constructed applications that many of us wrote before properly understanding the technology.

David Neale
  • 16,498
  • 6
  • 59
  • 85
1
  1. Buy a book on C# & .NET FW fundamentals!
  2. Read! :-)
Numan
  • 3,918
  • 4
  • 27
  • 44
1
  1. Read good books about .NET for example CLR via C#.
  2. Read this:

Hidden Features of C#? https://stackoverflow.com/questions/380819/common-programming-mistakes-for-net-developers-to-avoid

Community
  • 1
  • 1
Andrew
  • 1,102
  • 1
  • 8
  • 17