views:

191

answers:

5

The title speaks for itself. I'm building a winforms C# 2.0 app. Any tutorials or inspiring ideas?

+2  A: 

ADO.NET is a big topic - but the keywords to search for here are SqlConnection, SqlCommand, SqlDataReader, etc. If you like DataSet (I'm not a fan, but some people love them), then the dataset designer will do a lot for you.

Another option is to use a .NET 2.0 web-service (asmx) for data access via a central app-server - making it a "smart client".

With later .NET versions, WCF (.NET 3.0), LINQ-to-SQL (.NET 3.5), Entity Framework (.NET 3.5 SP1) and ADO.NET Data Services (.NET 3.5 SP1) become options.

Marc Gravell
+2  A: 

This article may help you to start:

Link

Aamir
+1 good article
m_oLogin
A: 

upgrade to C# 3.5 and use a Add->New Item->Linq to Sql Class... by far the easiest way i've ever seen, you can just drag from server explorer the tables you want... otherwise...

it's much more difficult in 2.0 until you get your rythym down, As previous poster i'd recommend SqlConnection and SqlDataReader, etc. Before .NET 3.5 we had an ancient helper method that simply did something like the following

DataAccessLayer dal = new DataAccessLayer("Connection String"); SQLDataReader sr = dal.getDataReader("SQLCOMMANDSTRING"); sr.Close(); dal.runProcess("SQLCOMMANDSTRING");

etc..

for some specifics on how to use the SQL objects check the following: http://www.developerfusion.com/article/4278/using-adonet-with-sql-server/2/

DNeoMatrix
It's still not exactly 'difficult' to declare a few classes, set some properties and then interpret the result. Besides. I much more prefer that people get down and learn what's really going on before doing drag'n'drop programming. =)
J. Steen
You mean .NET 3.5 / C# 3.0
Marc Gravell
yes, yes, sorry... i've been studying for finals all night, please forgive me. =)
DNeoMatrix
+1  A: 

There's not much difference between a local SQL Server instance and a distant one. You just set something like Server=sqlserver.remote-machine.com in your connection string.

Mehrdad Afshari
Well, there is if there is a firewall in the way ;-p And of course round-trip performance becomes more of an issue, depending on the meaning of "remote".
Marc Gravell
@Marc: Yeah, but this comment belongs on "serverfault.com" ;)
Mehrdad Afshari
+1  A: 

have e look here : Link

there are some good samples here.