Bug in VS2008 WPF Service Reference Updating

bugIt’s kind of a relief when you detect bugs in other people’s software. Specially if it is a wonderful product like VS 2008. It tells you that you are not alone in your incompetence in the universe. There are other programmers who make mistakes. Wonderful!

I found a nice little bugs that the VS folks didn’t squash in time. Here’s how to reproduce.

1. Create a web service.

2. Reference that web service in your WPF winapp project.

3. Write a new WebMethod function in that webservice.

4. Use that function in your WPF winapp project but don’t update the reference yet.

5. Now try updating the service reference after you’re using the function in the WPF code.

The IDE will crash without an error. Plup! it’s gone.

I am also using JetBrains Resharper so if this is not a problem in VS, then there’s a tinny-winny chance that Resharper is causing the crash. I solved it by temporarily commenting out the function reference in my WPF code while I updated the service. Then I uncommented the line.

Great find? Eh?

Using SQL Views after a long time

SQL Server

SQL Server

When I first started with SQL Server I found Views and stored procedures a really cool affair and the book I read highly recommended it for everything. So I overused it a tad in the dynamic website project that I was making and later reaped the consequences which told me that views are to be hated for exactly the same reasons why they are recommended.

- They’re not maintainable (Every time I changed something in the code to fit a new database requirement, I would have to go to the server and modify the View SQL so that it would give me the correct data.) If you are on a remote machine like I was, using RDC to log into the remote machine to make changes to the database is very slow and time consuming. I would found myself waiting for the screens to refresh for a long time while I impatiently tapped the keyboard all set to type in that extra field.

So I decided that views were killing too much of my time and from now on it would be strictly SQL in my code. Later when I re-wrote the website I deleted every view and replaced it with SQL code. It really made the site easier to maintain and I didn’t find myself waiting for refreshes any longer.

The same goes for stored procedures too. I removed them all.

Now I am making a web service to process online customer data for our organization, a part of our order-process reorganization initiative. In this project we need to extract data from a virtual table that presents a collection of data drawn from several different tables (this table de-normalizes the data to make it easier to process). One possible strategy was to write the SQL code for the table in every function I am going to access it in, or use it as a global variable, but that would force me to execute two queries… Not a smart idea at all.

So views were very practical and a great solution here. Views are like a virtual table at the server end, and very easy to call. They are optimized and fast. So there’s no major performance overhead.

I guess this is ONE place where sql views are really-really helpful.

How to set taborder in WPF

In .net Winforms you have to set the taborder manually and the fastest to do that is using the taborder toolbar. In my latest WPF application I was looking for the tab order toolbar, but couldn’t find it. A little looking told  me that in WPF the tab order is decided by the order that the controls appear in the XAML document. The earlier the control appears, the lower is its tabindex number.

So I just reordered my XAML document a bit and the taborder is working fine now.

‘Institutionalized’ That’s Not What Blogging is About

Employee FIRST, Customer SECOND

Employee-Customer

Been to a blog camp today. Didn’t stay long. Stayed through two sessions. The first one promoted HCL’s ‘Employee first, customer second’ scheme.

‘Employee FIRST, Customer SECOND’

Interesting. Though quite open to interpretations in many ways if the philosophy is not explained to its entirety. Well, I heard about it long enough to check it out, otherwise the message makes me want to make sure I don’t end up a HCL Customer :) . Well, no. The idea isn’t about neglecting customers. It’s about giving employees their due and then making sure they pay attention to the customers. Nice and workable.

The second session was by ‘Maddy’ Madhavan (I even remembered the name!). Nice old school journalist, with a fresh view of the blogosphere. He’s a fine speaker. Pretty extempore. And knows how to use the props and situations he runs into to his advantage. Should definitely do more of this instead of writing boring ol’ news stories.

What I don’t agree with though, was his idea that blogs need to be ‘institutionalized’  to be commercially viable. What he meant was that blogs need to work more like an institution, but frankly I would have agreed with him more if he had meant the other stuff (that blogs need to be sent to the looney-bin!).

The very few bloggers who’ve made it on the dint of some magical secret ingredient are institutionalized, but now they’re not blogs anymore. They’re institutions.

Not blogs. Blogs are free-wheeling, wild-running, amok-going, regulation-anti, free-speeching, rambly-ranting journals. That some become popular and yet others earn money for their owners is just a very pleasant side-effect.

Institutionalization of a blog would be like dunking it under the sink and then pouring bubble soap over it, and then scrubbing it hard behind the ears. When you’re done you’ll see everything is squeak-squeak. But that’s not a blog, that’s just squeak-squeak.