views:

96

answers:

5

Any good resources for setting up a Windows Form with C#? Looking to create my first database application using C# and VS 2008. Thanks any advice is much appreciated.

A: 

it seems like your mixing your terms up a bit.

Form is a window for a application, visual studio comes with a designer for those, that you can design your UI using drag and drop
For the database the microsoft sql server comes with a UI and a designer called Sql Server management studio. That allows you to design your entire database

EKS
I think the OP is well aware of that. Could be a simple typo, missing out the 's'. Your post sounds patronizing and doesn't even answer OP's question, so -1!
Wim Hollebrandse
Sorry I should have explained better.But this windows application will actually be just a collection of forms and eventually reporting.Looking for information on creating windows forms and tying them together with sql server. Once I can do this once then it is easy to replicate. Then I can begin to look into more functionality. I just need the basics at the moment so I can get a skeleton setup to work with.
Brad Woods
+1  A: 

http://windowsclient.net/learn/ has a lot of articles on Windows Forms, even though it's focus has recently shifted towards WPF

Stuart Dunkeld
+1  A: 

Well for a start off, use a good pattern (I found this the most important thing for WinForms apps, as the code soon grows to the size of Susan Boyle) - at the moment I like the MVP (Passive view or Supervising Controller) pattern. Links below are some of the best I've come across:

http://www.c-sharpcorner.com/UploadFile/rmcochran/PassiveView01262008091652AM/PassiveView.aspx

http://codebetter.com/blogs/jeremy.miller/archive/2007/07/25/the-build-your-own-cab-series-table-of-contents.aspx

As for Windows forms themselves, they're pretty straight forward with the not so obviuos pit falls - just make sure you de-register any events you register (mem leaks...)

But there is a good site (ahem codeproject ahem dot ahem com) with lots of guys on there who are just genius's Check out anything by Sacha Baber, I'm working my way through this myself ATM: http://www.codeproject.com/KB/cs/AutoDiagrammer.aspx

JustAPleb
+1  A: 

I would take a look at MVC or MVP to make your life easier and make testing a lot simpliar. Here are some good starting points:

What are MVP and MVC and what is the difference

Selecting a MVC MVP implementation for a Winforms Project

Implementing MVC with Windows Forms

SwDevMan81
A: 

There are some nice easy tutorials on MSDN to get you started on Windows Forms. How to: Create a Windows Forms Application is a nice introduction to building a basic Forms application. Then you could move onto the Walkthrough: Simple Data Access in a Windows Form for a little bit more advanced with some database interaction.

As you are going to be creating a Database application and interacting with SQL Server I would also consider looking into LINQ to SQL: .NET Language-Integrated Query for Relational Data. This will heavily reduce the complexity of your database interactivity. It will also automatically create ready-to-use Business Objects based on your Database tables which reduces the amount of coding you will need to do in your DAL. Scott Gu's blog article Using LINQ to SQL (Part 1) is a great starting point for learning L2S for the first time.

Also as others have already suggested, I would advise you read up on some design patterns to follow when implementing your application as it will probably help you in the long run when your application begins to get more and more complicated.

James