Tuesday, December 18, 2007

PDC 2008

It's announced ! PDC 2008 is planned to take place next Autumn in Los Angeles !
Let's hope it does take place, and let's hope i can go (any sponsors ? ;-))) ).

You you have the choice, DO NOT MISS this opportunity. It's an awesome experience !

Check out details here : http://msdn2.microsoft.com/en-us/events/bb288534.aspx

Wednesday, November 28, 2007

ASP.NET File Upload Content Type variations on CSV Upload

My object was to enable web users using http://www.joinup.ch to import their CSV-exported contacts into the application.

So I implemented a FileUpload via ASP.NET and checked for the content type to distinct between a 'real' excel file that was being uploaded, and a CSV file (exported by Outlook).

The content type for my own CSV file showed up as application/octet-stream, and the import worked nicely (http://www.joinup.ch/ImportInvitees.aspx), while files uploaded by a test user on two other PCs seemed to crash.

Please note that during all the tests, everyone was using Firefox, and not IE.

After some investigation, I found out that my browser/OS sent the ContentType 'application/octet-stream' for the CSV file i was uploading, others were sending
Content type: application/vnd.ms-excel


Now, that seemed quite strange to me. But apparently, depending on the Office/Excel version a user has installed, the content-type changes. Having installed Office (2002) on my own PC, my browser sent 'application/octet-stream' for the CSV text file I uploaded. If there is a newer version installed, the ContentType seems to change to the one mentioned above.

Why Firefox sends a different content-type depending on the Office version puzzles me a littlebit, but this can be handled, once aware.

So if you ever need to upload/import a CSV file to a web application, don't rely on the content type to be the same.

Finally, I kept checking for the content type value, but I also checked for the file extension to make sure to use the right import procedure.

I admit that application/Octet-stream doesn't help much for Content-Type. But the fact that the contenttype value changes depending on the installed application seems a bit scary to me. But then again, most of us have already got used to the fact that MS Software affects many System settings, and this one seems to be one of those. Sad but true.

I will futher investigate on this topic and try to find the definite and clear reason for this.

Thursday, September 27, 2007

ClickOnce - move install/update location

After having used ClickOnce with the Smart Client Software Foundation Framework, we had to move the installation location, as the server was replaced and re-organised.

We were assuming that our customers who use the client, which is currently only partially rolled out, will have to manually reinstall the client by calling the appropriate new URL, as simply changing the update location in the Manifest file doesn't impress the client and doesn't cause any action.

After some HTTP sniffing, I found out that the ClickOnce client does, as hoped, check back on the installation server and opens the .application file, which is already good but obvious as well. As I wrote, simply changing the update/install location in this manifest file doesn't lead to any updating (which makes sense, keeping in mind that this is the first ClickOnce version and a beefed up release is on its way). So I tried and updated the "Required Version" setting in the server manifest file and re-started the application on a client. Again, it opens the now updated manifest file, triggers an update and thus causes the app to start downloading a new version (which in the meantime needs to be around on the new server).

Conclusion: Also installed clients can be pushed to accept a new install location, without manually touching all client instances.

Requirements:
- New version needs to be published (to new location)
- All clients need to be updated prior to disabling the old install location

Steps (for the more efficient reader in short form):
- Publish a new ClickOnce version to new install/update location
- Edit application_name.manifest file on old/current install location to reflect new install location AND
Increase Minimal Required Version to indicate version published on new location
- Make sure that all installed clients update themselves
- (NOT TESTED) Switch off old install location

Wednesday, September 26, 2007

Two interesting / curious C# links

Due to constrained time situation, I am simply posting two links that are related to .net / C# software development.

1) After having implemented a BindingListView for custom data object class including operators for >=, <=, begin with and end with operators myself, i found an article online outlining exactly this. :-)
Jesse Johnsons BindingListview implementation for custom objects

2) Admittedly, some things i still can't understand in the .net Framework: One of those i just found today is that the DataGridView DOES support DoubleBuffering (as it is inherited from Control), but that property is not public. Maybe i am a bad software designer, but why wouldn't one make that Property public right from the start ?
No explanation here, just a confirming my words

Thursday, July 12, 2007

Showing/Hiding DataGridViewImageColumn Image

While developing an overview page that displays orders and their state, I needed to display a "Has been printed" Image after the order confirmation papers had been printed out. The intuitive thing to do for me was either to write a custom DataGridView cell type, or to use the DataGridViewImageColumn/Cell type. I was confident that the latter would lead me closer to my solution, although already suspecting that the Cell-Value would not be a boolean that indicates wether or not to show the image. So easily hiding the image wouldn't work.

So the only option i could come up with was to use (like in typical Web applications) a spacer image that simply consists of transparent pixel(s).

As the column was data-bound, I implemented a property that returned an image stored in my resources. It all might sound too simple and plain stupid, but there are quite a few people asking that question on the Net. So i post my property here, maybe it helps somebody:

public System.Drawing.Image WasPrintedImage
{
get
{
// Boolean property indicating the print-status
if (WasPrinted)
return ((System.Drawing.Image)(XY.Properties.Resources.PrintingDone));
else
return ((System.Drawing.Image)(XY.Properties.Resources.Spacer));
}
}

Tuesday, June 12, 2007

Safari Browser for Windows !

Kind of an unexpected news item: Apple is releasing Safari Public Beta 3 of their up until now Mac-only Safari Browser for Windows !
Even though i am not a huge Apple-fan (yes, their iPod was a revolutionary invention and so is Mac OS X), I immediatly wanted to look at this new enemy after the two main competitors (IE and Firefox) sort of became friends (MS is very much embracing Firefox these days and seems to be doing quite a lot to accommodate other browsers as well. In my opinion, the last months have been the most promising for Web Developers).
At first, I was thrilled knowing that there would soon be a different browser in the game, but after installing it, I must say that I am WORRIED!

a) Apple continues to dictate more and more their terms: Downloading the browser is not possible without leaving your email address. Not a real issue, and fake addresses are accepted as well. The iPhone will (rumours tell) have a permanent SIM-card, thus Apple dictates which Networks you can use - and even makes money with each conversation you hold through your iPhone...
b) Apple is trying wherever possible to include Quicktime in your download. iTunes requires you to install Quicktime (i forgot to mention that I do not need Quicktime, find it a memory hog and for a Windows Application, the User Interface is just not to my taste). And at the moment, they offer a download link for Safari including Quicktime, and one link with just Safari. I assume that the second option will be gone soon.

c) The browser displayed most of my test websites I looked at (www.news.com, www.mozilla.org, www.cnn.com, www.joinup.ch) in a horrible layout, leaving even news headlines on www.cnn.com completely unreadable (several lines of text on CNN only rendered as a single pixel line !

d) The User Interface looks like the typical Apple User Interface (take iTunes or Quicktime).
Nielsen or any other Usability-geek probably starts to shiver as we speak.

e) Installing Safari went smoothly (without Quicktime of course :-)) on my Office PC (standard-config), but launching Safari twice resulted in two crashes after visiting a few Web Sites, having used it for merely three minutes.

Granted, it's a beta, but it's a public beta, and it's beta three.
But it's public.
It does look good for everyone who likes it - but it doesn't at all fit into any Windows UI. And it doesn't work. Crashes and very very obvious rendering issues (big parts of Web Pages were simply missing!) don't speak for Apple this time.
Every Beta 1 Microsoft for example releases is much more stable than Safari Beta 3. So for now, i'd recommend to either use it on a Mac or not at all. Take Firefox or even IE7, you'll be much happier.

It remains to be seen how this all affects Web Developers. Will the have to embrace yet another browser that renders completely different ? Or will Apple manage to adhere to Standards at least in the area of a Browser like Firefox or Opera ?
I hope so - otherwise, developing Web Applications will get even more costly on the part of CSS and styling then it already is. And that can not be in any interest, not even in the Google/Apple/Yahoo conglomerate.

Let's see - it definitely won't be as peaceful anymore as it has been in terms of browser-war.
:-)

Tuesday, May 29, 2007

PDC 2007 postponed & Excel Autofilter DataGridView Column

As usual - shortly the two most important news and discoveries of today:

Microsoft is postponing its PDC 2007 !
It's a real pity (and a bit very short-noticed at least for non-US citizens), but Microsoft just announced that it's postponing the PDC 2007. It was forseeable that I won't have the time to attend anyway this year, so I am rather happy than angry (fortunatly I haven't already booked anything) because that leaves me the option to attend at an easier point in time.

.net: Building a DataGridView AutoFilter HeaderCell
Check out this MSDN article, which helped me alot building a AutoFilter header cell for the DataGridView (Windows Forms). I have to admit (coping with Windows Forms for a bit more than a year) that the article is very well written and the result is quite cool and adheres to OO-principles perfectly imo. But in a not so quiet office, fully understanding everything takes a bit, but gives much-needed and very interesting insights into some key-concepts of the whole .net Framework.

Saturday, April 14, 2007

My first TechDays 2007 Zurich visit

TechDays 2007 in Zurich is over and it was definitely a very interesting event with lots of impressions and many things to learn.
While I found that many sessions were rather general and tried to focus on all Developers, Decision Makers and Sales People, there were still quite a few sessions that gave good insights on common problems a developer faces almost daily.

Particular highlights i found were
- the keynote about security, held by Rafal Lukawiecki (whom i funnily enough knew from years ago from London already). Prior to the keynote we all found the topic 'Security' a bit of a wrong choice to listen to for 90 minutes. Sure, security is a key topic in our work, it's hardly ever an interesting topic. But I was proved wrong - Rafal managed like nobody i've seen before to make it a very entertaining, interesting keynote and dug up some very interesting facts that got me thinking - hopefully our future regarding security and malicious attacks is not as dark as it can possible become (although trying to be a realistic person, my hopes might go unheard).
- Ingo Rammer impressed with his in-depth knowledge of Windows Workflow Foundation and Hardcore debugging. While i have been paying attention to Windows Workflow Foundation (WWF) for more than 2 years now (starting at PDC 2005), the product is just about starting to get to a stage that can be used for production, but has some very nice concepts. I was definitely encouraged by this session to finally try it sometime soon.
Hardcore debugging was VERY impressive. I would definitely not say about myself that I don't know alot about technical and internal details of .net and ASP.net. But what Ingo showed off here was a) very very geeky, which has become rare and thus a very welcome change every now and then for me and b) will definitely proof very helpful in the near future. To almost completely debug a compiled application on a production machine without installing Visual Studio, without adding log messages until the database is flooded with such messages, will certainly make it easier to find nasty production-only bugs in an application.

About the location: Why Microsoft chose our very old-fashioned (and due to rebuilding) congress hall is still a riddle to me. The location of the event hall is definitely awesome (in the heart of downtown Zurich, just next to the see, making it easy to enjoy a short stay off any session, enjoying the sun lying on the lake), the rooms were small, cramped and with hardly any leg space, which made it very difficult to sit still for 75 minutes or more. Why not choose the new exhibition and fair center that is modern and spacious and convenient ?

Anyway, it was a nice event with a good mix of visitors - and now it's time to look forward to PDC 2007 ;-) which i can hopefully attend.

Tuesday, April 10, 2007

TechDays start tomorrow !

The TechDays 2007 in Zurich/Switzerland start tomorrow ! It's my second 'Microsoft' event after PDC 2005 in Los Angeles.

It should be interesting to see the difference to LA (which will be substantial), but it will be good to meet local people and do some networking here as well.
More during/after the event, which will definitely be filled with new impressions and opinions to state here on my blog.

Monday, March 05, 2007

Visual Studio 2005 Team - get rid of all the Wizards and magic and fix the Windows Forms designer !

After working with Visual Studio 2005 for almost three years now (approximately), having used ASP.net (C#) extensively as well as Windows Forms (C# as well), I think I am able to compare support for those two very different technologies when it comes to Visual Studio support.
After being pretty impressed by ASP.net Support in Visual Studio 2005 (already without the patch), expectations were high when starting to plunge into the WinForms world (i did get in touch with the Designer every now and then, and especially in 2000, when working on a Visual C++ Windows Forms project in study, so i definitely expected more out of the designer than it offered 7 years ago).

First glimpse suggest that the Winforms Desiger is pretty much full-fledged, supports a variety of functions and special tasks, can generate data-bound forms out of a database scheme and so on and so on.

Having said this, generating data bound forms (apart from the fact that i in general rather go for manually coding the data binding) mostly results in a crash, at least with Oracle 9.

Other annoyances include (but are not limited to):
- Selecting and moving controls is not possible while they're set to "Dock = Full" - makes absolutely no sense to me
- The designer recreating .designer code upon compile. Out of several tens of forms, one certain form that is set up of a table layout and an embedded DataGridView spaning 2 rows, is modified by Visual Studio 2005, and the rowspan of that datagridview is lost - so it's being reset to 1. Happens ALWAYS and to always the same form..
- Occasional error messages when open in design view - closing the form and reopen it again usually helps - occured a lot with CAB projects.

And yes, i am talking about Visual Studio 2005 Service Pack 1 !
For a software development application with which probably most Windows Applications are being developed, such issues seem sort of ok in a first version to me. But if one includes Visual Studio 2003, VS 2005 SP1 is the "third" evolution of this breed. Now all i can hope is that customers buying the Team Edition (for quite some money...) DO have a better designer - although out of experience, i highly doubt that.

So not much has changed compared to pre Service Pack 1 for Visual Studio 2005 - i still look forward to the Visual Studio Service Pack, which is desperately needed (even after SP1).

(Don't get me wrong, out of the available Software Development tools out there, Visual Studio is definitely most advanced and convenient, though the priciest as well i assume).

Wednesday, February 28, 2007

Selling (Windows Vista) Digital Rights Management

Pheeeew. DRM (Digital rights management) has been on the market now for quite some time, but apart from the content industry, nobody likes it.

Why is that ?

- Worst of all, the product "DRM" doesn't deliver anything 'positive' to the user. By having it, you get more hassles and less control than you do by not having it (hence my avoidance of anything that only smells like containing DRM).
- Almost as bad: "DRM" can not be touched - sounds silly but imo is a major drawback. How can a product like DRM be anyone's friend when it's not controllable ? How do I know how much of that thing is in my PCs ? There is no real control panel, no statistics about how much content i was only able to listen to THANKS to DRM. There is nothing positive communicated to the user. and that when every marketing department emphasizes on User Experience.
- Content companies have pretty much (and one could really think deliberatly) ruined their reputation. and it's exactly them who push DRM into Vista. From broken CDs, hidden root kits that cause Windows machines to become (even more) unsecure to buggy drivers being installed silently, little good has been heard in that area recently.

Obviously, Microsoft had to cope with DRM in some why while developing Windows Vista. The rumours around might be true (but definitely help to make customers rather hesitant) or false, or both, but they don't help to boost Vista sales, and show how difficult the whole DRM discussion is.

It's a shame really. Vista is beautiful and i'd consider installing it on my PCs too, but DRM is the one best reason not to do so. And getting facts about what is in Vista and what is not consists of asking two big brothers: Microsoft and the content/music/movie industry. Now do you trust any of those two to deliver a true answer ?

Blog discussion about conflicting DRM & Vista 'facts'

Wednesday, February 21, 2007

TechDays 2007 in Zurich - Registration open !

My second "big" Microsoft Event: TechDays 2007 in Zurich/Switzerland ! Registration is now open, and i am already looking forward to it quite a bit ! Won't be anything like the PDC 2005, or at least I don't expect as much, but it will be good to meet people and learn about the latest plans and ideas MS is coming up with !

Tuesday, January 30, 2007

ASP.NET AJAX "Compatibility" Validator errors

The final version 1.0 has been released and ASP.net AJAX (notice the vanished ATLAS, although i'll miss it..)is out ! It is and has been fun to update pages to use AJAX, which usually went somewhat smooth and - the effect gained by some rather little work was worth every line of additional code. It was a bit of a pain though to migrate ATLAS to AJAX, but it took less than expected (about 1.5 hours for a medium-sized small Web Application) and it's well documented. Just look for the MS Word ATLAS to AJAX Migration documentation. Thanks to Microsoft and the involved developers for all that, it has been a really fun time to watch the toolkit progress and to use it.



Unfortunatly, it's not all bushes and roses.. After migrating the application, installing an extra DLL in the bin folder on the hoster's web server (it's being installed to GAC locally, which in my opinion doesn't make sense (from a not so experienced developer's point of view), the app seemed to be fine and i went off on a holiday. I was not convinced though, that the application would now run fine inluding the migrated code/web.config and the new DLLs it would give me in a new AJAX project.



After a few days, a friend called to say that one rarely used page wouldn't work anymore, it used CompareValidator amongst others. Fortunatly and fascinatingly enough, a wireless network was around (and although being at the other end of the world on a beach vacation, how could i resist to fix that issue... :-) next time i'll leave my notebook at home... NOT) and i decided to look for others having the same problem. And VoilĂ , even an MS blog writer blogged about this exact problem, and pointend me to an additional download to store into the BIN folder.



Well, it all works, which is cool. But the aforementioned issue seems typical (sorry MS but that's my opinion). Apparently when MS released the ASP.net AJAX final release, they decided to take out the DLLs for AJAX Validators within UpdatePanels. The DLL was supposed to be shipped by Windows Update as we speak. But MS got delayed and silently postponed that work to some later time. So the DLL wouldn't be installed anywhere, leaving one unable to use AJAX Validators, among other controls, anymore... Now, the twist is that that DLL will (...) come out in the next two weeks. Why MS had decided not to communicate the substantial mishap to their "user-experience" conscious users probably remains a riddle...

You can get an extra DLL, don't worry, and using that one seemed appropriate and hassle-free.

(see http://blogs.msdn.com/mattgi/archive/2007/01/23/asp-net-ajax-validators.aspx)



Just how can it be that MS cancels a rather important and widely used DLL, doesn't mention it (at all ?) in the CES consumer show or in the migration document ?!



Also, it's being promised that on the servers, a replacement DLL will be installed (into GAC i assume) by Windows Update, but MS couldn't make it in time.



Tuesday, January 09, 2007

.net DataView Filter conditions and ignorecase & oracle

First of all, Happy New Year and all the best for 2007 ! It all looks fairly good around here and plenty of work is around.

To start off in the new Year, while developing a CAB / Smart Client Software Factory application based on Oracle, I was facing the same problem twice and can't wind myself out of solving it.
The problem is simple: A DataView containing several rows with columns holding Integer (numerical) values and strings. For one certain Use Case, the application needs to go through the Table and create a DataView that filters out rows that don't contain a certain string. As the user is always King and thus can enter lower- or uppercase search terms, we want to ignore the case and return everything that just matches his query. In SQL Server, you'd enter a Filter a la: " searchColumn LIKE 'searchTerm'". SQL Server knows by itself that it should ignore the case in this case.
(column = 'xY' takes case into account, while column LIKE 'xY' returns everything from xy to XY etc.).
Oracle doesn't... Even using the keyword LIKE causes Oracle to care about case. Now you'd say:" Ha, just uppercase both the search term and the column a la UPPER(column) LIKE (searchTerm)". Simple enough... BUT: Microsoft doesn't support such a keyword in the filter pseudo-query language...

There seems to be no decent solution for this so far... Well done Microsoft..... Parts of the .net Framework and the ideas behind it are truly great and awesome, but on some other ends, some developers/marketing guys definitely should have been a bit more attentive.

Maybe someone knows a solution that can be used for dataview filters in .net 2.0 ? i doubt it... unfortunately.