You know, it's the little things that make .NET 2.0 so much more whole than the previous versions ever were. Take connection strings for example. In a typical simple app, you'd probably want to store these in app.config (yes, I'm talking Windows Forms here). You'd probably cut and paste string and change the database name from another app, or maybe even sit down and risk typing the whole damn thing in by hand risking errors along the way cos you're bound to catch them as soon as you run the application anyway.
In Whidbey, and C# Express it's a whole lot easier. Just right click on the project, and choose to add a new blank database in. Give the database a name and instantly you end up with a nice fresh app.config file in your project. Open it up, and you'll find something like this
Which rather handily contains the prebuilt connection string, in this case pointing to local SQL Server 2005 database file. But, what about getting that connection string into the application? Do you still need to do that old System.Configuration.Appl.blahblahblah stuff? Nope. The handy auto generated connection string is pretty much all you'll need string conString = (string) MyApp.Properties.Settings.Value["Connection"];
I know it's trivial, but to me that's just very cool. It's the little touches like that are going to make .NET 2.0 just so much more accessible to newcomers than ever before.
5:09:12 PM
|