Whidbey

Next Tuesday (Dec 9th) Object Sharp is hosting a free half day seminar on VS.NET 2.0 (Code Named Whidbey).  We'll show a lot of the new features in the IDE like snipits, expansions, snap lines and smart tags. We'll show you new features in C# and VB.NET, also ADO.NET and ASP.NET.

I think you will really enjoy this informal look at the next wave from a developers perspective.

Come on out. It's free and you just might learn something. You can register here.

 

VB who knew?

I haven't written anything in my Blog for quit some time. Mostly because I have been preparing for presentations. We helped Microsoft with their Bigger Better Basic cross Canada tour last month. I spoke in Toronto, Ottawa and Vancouver. It was great. We met lots of wonderful people who were all very excited about Web Services and Client Applications. I'm sure you can tell by the name that the show was for VB developers. My colleagues will tell you it's pretty humorous to say the least that I would wind up speaking to VB developers about how great VB.NET is to develop in.

At one time I would have nothing to do with VB. It was not Object Oriented, that was enough right there. ADO was not great, ASP was not great. It was just too hard to do anything. Well I'm hear to tell you, “VB has come a long way baby“. I was speaking with someone at the show on this very subject. They said “If you told me 1 year ago VB would one day have Generics I wouldn't have believed it”

I still prefer the syntax of C#. In a paste life I was a C developer so I am used the the sparse syntax and I like curly brackets. However, although I still find VB a bit verbose for my taste. I have been developing an application with it and it's a good language, VB.NET has a lot going for it.

EnforceConstraints

Have you ever tried to update a Dataset and received this message?

Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.

Not a problem in a small DataSet. But if your Dataset is more complex sometimes it's not easy to see the problem right away.

There is a property on the DataSet called EnforceConstraints. When you set this to true the DataSet will try to enforce all the constraints in the DataSet (Not null columns, Foreign keys, unique keys) The problem with this exception is, it tells you very little. You know you have violated a constraint, but which one? The way to find out is to look at the row and column errors.

Below is a method that will attempt to apply contraints and write the errors out to the output window. I hope someone out there finds it useful.

Public Sub GetDataSetErrors(ByVal ds As System.Data.DataSet)

 

Public Shared Sub GetDataSetErrors(ByVal ds As System.Data.DataSet)

 

Try

ds.EnforceConstraints =

True

Catch ex As Exception

Debug.WriteLine("DataSet errors: " & ds.DataSetName)

 

For Each table As DataTable In ds.Tables

 

Dim ErrorRows As DataRow()

ErrorRows = table.GetErrors()

 

For Each row As DataRow In ErrorRows

Debug.WriteLine("Table: " & table.TableName)

Debug.WriteLine(" Row Error: " & row.RowError)

 

Dim ErrorColumns As DataColumn()

ErrorColumns = row.GetColumnsInError()

 

For Each column As DataColumn In ErrorColumns

Debug.WriteLine("Column: " & column.ColumnName)

Debug.WriteLine(" Error: " & row.GetColumnError(column))

 

Next

 

Next

 

Next

 

End Try

 

End Sub

PDC Aftermath

It's now the Monday after PDC. I just woke up.

What a week! I didn't get a blog entry in on Tursday it was a very busy day. Talked to some ADO Microsofties about DataSets and Object Spaces. Sat in one a few last sessions. Did some shopping. Headed for the airport. For the next 12 hours we travelled.

Now I have to sit down and watch all the presentations I wanted to go to but couldn't get into, or picked something else.

I hope the DVD comes soon.

 

Bigger Better Basic

Over the next month we are co-presenting with Microsoft at their cross Canada tour called Bigger Better Basic . ObjectSharp will be in 5 cities Calgary, Vancouver, Toronto, Montreal and Ottawa.

Come on out.

Food at PDC

I can't go all week without mentioning the food, here. I took a couple of pictures to get the point across. Check out my pictures. it will help you visualize.

I took a picture of the lunch and breakfast hall. I got as much in as I could with my camera. Imagine seating 8000 for lunch. It's quit amazing to watch, the staff here at the conference centre are great.

All around the conference centre there are tables full of food. There are two pictures of these also. They are always full of muffins, bagels, chips, chocolate bars, granola bars and fruit. There must be 10 of them set up. Next to these are giant coffee urns and barrels full of pop juice and water.

No one is going hungry here!

C# now there's a language

Did I mention msbuild? Microsoft is writing their own NANT. It's XML and everything.

Yesterday was a C# day for me.

I tried to get into Anders Hejlsberg's session on the new features in C#.

  • Generics
  • Iterators
  • Anonymous methods
  • Partial types
  • Property accessors with different accessibility

But it was full. Even the TV outside the room had no space around it. They sometimes re-run popular sessions. Fingers Crossed.

I did however get into a good session called Visual C# "Whidbey" IDE enhancements for the C# developer

Found some things in there to look forward to.

Debugging is easier with regard to DataSets. In Whidbey you can adjust what you want to see in the debugger. You can tell VS what you consider your code and therefore want exposed in the debugger. You can also click on a drop down and see a DataSet Visualizer, which is essentially a list box of DataTables and a grid for the DataRows and DataColumns. It's like a trimmed down version of Barry's DataSet Debugger. In the build I saw, it’s not as good as Barry’s but maybe it will get better.

Here's one Andre will like. They have included IDE support for refactoring code.

Rename - You can rename a method and have it change solution wide.
Extract Method - If you wrote a large method and later decide it would be better split into multiple methods. You can highlight a section of code and select [extract method]. Whidbey will prompt you for a method name. It will figure out what arguments you need the scope and what it returns.
Some others include:

  • Extract Interface
  • Encapsulate Field
  • Reorder parameters
  • Remove Parameters
  • Add Parameters

Expansions are cool too:
You know in VB .net how you type in a property and it fills in the get and set etc. VB had to do this because it's so verbose no one would use it otherwise. :)

Whidbey has something else cool called expansions (C# has it for sure. I have not confirmed VB). Using XML you can define an expansion, which shows up in IntelliSense. Lets say you wanted to create a property expansion. You could type in prop and it could fill in the following. the cursor would be placed on string ready for you to change. You can just tab through the fields (in yellow) to change the names.

private string name;

public string Name {

get { return name;}

set { name = value;} }

That's enough for now. I have to get to another session.

We are going to Universal Studios today whoohoo!

Tonight is universal studios night. Microsoft rented the park for us for a few hours. I can't wait. Shrek 4D here I come.

The network at the hotel sucks. Couldn't get on last night for any longer than a minute or two. We were supposed to be in a web cast with Microsoft today but couldn't get a spot quiet enough with a stable network to do it.

Got an email from Roman this morning. Thanks Roman. Seems the dart team lost last night. Hard luck guys. I was thinking about you.

Right now I'm in a session for the tester in me. “Avalon” UI Automation to improve application testing. It's just starting so I'll be right back.

 

Tuesday Morning at PDC

Good Morning...

Barry said it best, “I woke up this morning needing a nap”.

Had trouble installing Longhorn last night, couldn't get the key from the web site. Barry got his so I can install it later on.

Just had breakfast with Joe Futty, Yeah he's here, he's doing well. It’s good to see him.

Waiting for the general session to start, I forgot my camera this morning. I have to remember to take a picture of the never ending dinning hall. Who is cooking all this food?

I want to try and talk to Paul from the Whidbey presentation yesterday. I'd like to get on the Whidbey Alpha. We need a newer build than the one they gave us. We want to hold a session in December to show clients some of the stuff we've seen this week. I think I'll go to ask the experts tonight. He should be there.

Barry was schmoozing with the infragistics guys last night at the trade show. They don't have anyone who does training for them. Matt? Barry said maybe we could do that for them. ComponentOne was four booths over. :)

For other attendees: Have you been to PDCVIBE and downloaded the PDC Vibe tool. It's pretty nice. Shows all the sessions, lets you filter them. Give feedback on PDC. Download slides. It's very nice.

Almost time for the general session, I better run.

Whidbey is looking good

Yet another long day, I feel like I have been at this conference for a week already, I'm exhausted.

At this moment I am installing Longhorn on one of the extra laptops we brought for just such an occasion. I hope they don't monitor hydro usage per room because between the wireless router, 2 phones, 3 IPAQ's, and 4 laptops plugged in we must be over our quota.

After I install Longhorn, I'll be installing Whidbey. For those who don't know, Whidbey is the code name for the next release of Visual Studio. I'm a software developer and have been for 20 years. So when presenters are on stage using old editors and compiling on the command line. I'm with them and sometimes feel a little nostalgic. As much as I once loved K-edit I wouldn't trade Visual Studio .net for it now. Like any software VS.net has it's problems. But the development teams at Microsoft have done a wonderful job addressing a lot of the issues. Assuming they deliver what I saw today.

So what did I see today?

  • I saw tools to make interactive development easier. Like smart tags. You can drop a control on a form then right click and make it something else. Maybe it was a textbox at first but them you decide to make it a date time picker. Just right click select DateTimePicker and you’re done.
  • Ever want to try something by coding it? As a result you end up with WindowsApplication1, WindowsApplication2, WindowsApplication3 ... on your machine. Whidbey works like word, your project is not saved until you save it. So you could create a project write some code compile it and run. Then exit without saving and discard the whole thing. (Honest that's what he said.)
  • I saw Paul Yuknewicz create an employee.user.vb. What's that you say? Well it's what Microsoft refers to as a partial class. You can have a class split across multiple files and they will be compiled into one. So the file employee.user.vb goes with employee.vb which goes with employee.xsd. You guessed it. It's an extension of a Typed DataSet. :)
  • The new snap lines for aligning controls are wonderful. If you are adding multiple labels and controls just drag one near another and it shows you lines to tell when it's lined up with the other controls and the labels. It's hard to explain how nice it looks. I'll be happy to demo it when I get back.
  • There is this thing called a DataSource Picker. To bind a control you can simply drag from you DataSource to the control and it binds it.
  • There is this new control called a DataContainer, all I can say is PowerSoft DataWindow. (I'll save the comparison for another Blog)
  • There are some enhancements to the XML editor. Nothing else to see here move along.
  • Actually one really note worthy XML addition. You can set breakpoints in an XSLT file and debug it.
  • Oh yeah I remember this is nice. When you add a datasource to DataBinding in the property window. You can grab the editor and stretch it out to see everything. It's really nice

Enough about Whidbey for now.

The exhibition hall was cooking tonight, must have been the free drinks. We stopped into a few booths, chatted with some folks, did a little shopping in the Microsoft Store. Can't tell you what I bought. My Daughters have been reading along, and it's for them.

It's time to unwind and relax, another long day tomorrow at PDC.