Programming

Visual Studio 2008 SP1

I’ve just installed and configured Visual Studio 2008 Service Pack 1. This is still in BETA but I was anxious to install and try it because of a bug fix that Microsoft were putting in after I logged a bug report with them in January. You can find that here if you want http://www.trstechnology.com/blog/asp.net/index.php/visual-studio-2008/

The bug fix was specifically to allow the use of a remote IIS Server. The initial version only allowed you to specifiy a local IIS Server.

I’ve just tested it and it works perfectly! Thanks so much to Bill Hiebert and Joe Cartano and the team at Microsoft for the fix.

Here’s the new option on the web properties tab;

image

Visual Studio 2008

I’ve recently installed Visual Studio 2008 and related software. I was hoping to upgrade and start developing in it as soon as possible.

I’ve generally always been an early adopter, but didn’t move to Visual Studio 2005 until quite late in it’s life cycle. I’ve since decided that was a mistake. It’s far better to be on the curve early than to come in late, or even miss a version and come in a versiion behind. Not a good idea.

Now, I know that Microsoft, God bless them, have had a really hectic schedule with the release of Vista and now Server 2008 and SQL 2008 coming soon. But, for heavens sake, I have a problem with using Visual Studio 2008 in my development environment and it’s a show stopper.

I always develop against a remote Windows server using IIS etc. That is so that I’m effectively running up against an environment that is pretty close to production. I haven’t had any problems with this for the last 4 years.

 I installed Visual Studio 2008 and tried to convert an existing project and VS couldn’t seem to access the development share. I then tried to create a new web application project with the same results.

 I’ve posted a thread on the ASP.NET forum. No replies to that yet…

And I’ve posted a bug report with Microsoft. I know that all environments may be configured slightly differently but if it’s working in Visual Studio 2003 and 2005 I certainly expect it to work in Visual Studio 2008. What a bloody pain!

Google API

Well Google doesn’t like you to use their maps api unless you pay them 10 grand for enterprise use, so we decided to go a slightly different route. The problem was that G blocked the service to our IP address for 24 hours after repeatedly using the service. Thanks G!

 Instead of using the API we used the Google maps online service, passing the address as part of a query string and then parsing the results. Although this is a pain to have to parse the resulting html from the maps.com service, it still works and the results ate consistent, although, be aware, the lat and long results from the API are different than from maps.com!

Here’s how to do it in .NET

‘first we create a request Dim req As HttpWebRequest = CType(WebRequest.Create(“http://maps.google.com/maps?oi=map&output=js&q=” + paddress), HttpWebRequest) req.Method = “POST” ‘set the content length of the string being posted ‘create the stream amd write it and close req.ContentLength = 0 req.ContentType = “text/xml”‘now get the response Dim res As HttpWebResponse = CType(req.GetResponse(), HttpWebResponse) ‘read it into a stream and close Dim sr As New System.IO.StreamReader(res.GetResponseStream) PostGEOOut = sr.ReadToEnd

Once you have the resulting html you will need to parse it to get the results. I will post that code soon

 

Geocoding with Google

I’ve been working on a project using the Google maps API recently. I’ve been using it to return the latitude and longtitude of an address and then comparing it against a geo-coded file in a database.

The Google maps API is pretty extensive and fairly easy to use. However, there are some things that you need to be aware of. The first thing is that Google does not want you to use the GClientGeocoder object to geo-code large files. If you want to do that, they want you to sign-up for an enterprise version of the geo-coder, and the cost is an astounding $10,000!

More on that in a later post. For now, here’s a map to play with…

As, you can see, it’s pretty easy to insert a map. You need to get an API key from here. Once you have that, you’re pretty much up and running.

I’ll post some more on the API later and show you some AJAX code that returns the latitude and longtitude results back to the server side for processing.

Project Management – The Art Of Managing Expectations

We all work to deadlines, well most of us anyway. Truth is, a lot of times those deadlines are  self imposed, other times they are required to be met because an external force is in operation.

I’m always willing to move a deadline backwards if the proper, agreed upon testing has not been completed. This is especially important when the system is mission critical. The problem is without a hard deadline, i.e. an external force, could be a service agreement termination, change of host, whatever it is but an outside, beyond our control type scenario (I hope you get the picture here…), without a hard deadline a project delivery date can quite easily slip backwards. This is often due to the requirement of testing to be performed and completed before roll-out.

I find myself managing two projects that are in the testing phase now. One is late, well not actually late but ongoing in testing mode awaiting sign-off. This is a nasty place to be but I have to sit tight, grin and bear it while the test process continues until the customer is happy and willing to sign-off. The problem is cashflow, I don’t get paid until we finish, but I can bear that and am willing to do so until the customer has completed their testing. In this case I’m managing their expectations by not trying to hurry them, speed up their internal test process or ask them to sign-off.

In the second case, my customers development team has been delayed and the project plan delivery date is this coming Monday. There are at least 1 days worth of development and another day of testing required by them before we have completed the plan. The customer now wants to rush the final development and testing so that we can deliver on time. In this case there is also no external driver and I’ve allowed the customer to slip back because of other deadlines they are trying to meet. However, I’m not willing to sign-off until they have completed their development and testing. This is a tricky situation but I will have to manage their expectations by not signing-off on the plan, it is unfortunately unfinished. No doubt we will push back a couple days, get all our ducks in a row and roll out on Wednesday next week? We’ll see…

Dataset.ReadXML or ‘O Schema, Where Art Thou’

I’m still cranking ot XML by the bucket load and ran into an interesting solution to a problem using the datasets and readXML.

I wanted to use datasets rather than XPath or XMLDocument or any of the other readers. However, I was having trouble mapping the XML schema to the dataset paradigm in my mind. So I found this niffty piece of code and tweaked it. It helped me a lot!

Public Sub PrintDataSet(ByVal ds As DataSet) ‘ make an output file for the schema Dim fn As String = Request.PhysicalApplicationPath + “\theOutputfile.txt” Dim dw As StreamWriter = New StreamWriter(fn) ‘ Print out all tables and their columns For Each table As DataTable In ds.Tables dw.WriteLine(“TABLE ‘{0}’”, table.TableName) dw.WriteLine(“Total # of rows: {0}”, table.Rows.Count.ToString) dw.WriteLine(“—————————————————————”) For Each column As DataColumn In table.Columns dw.WriteLine(column.ColumnName + “: ” + column.DataType.ToString()) Next ‘ For Each column dw.WriteLine(System.Environment.NewLine) Next ‘ For Each table ‘ Print out table relations For Each relation As DataRelation In ds.Relations dw.WriteLine(“RELATION: {0}”, relation.RelationName) dw.WriteLine(“—————————————————————”) dw.WriteLine(“Parent: {0}”, relation.ParentTable.TableName) dw.WriteLine(“Child: {0}”, relation.ChildTable.TableName) dw.WriteLine(System.Environment.NewLine) Next ‘ For Each relation dw.Close() End SubThe output file looks like this xmldatasetprint.txt, which, believe it or not, makes a lot of sense too me :)

The Return Of DLL Hell?

DLL stands for Dynamic Link Library and the Windows system and Windows programs run on DLL files. Iy you go and look in your \Windows\system32\ folder you will see thousands of these files.

If you don’t know what DLL Hell is you are a very luck person! The term ‘DLL Hell’ was coined because of the problems and frustrations that were caused by DLL Hell.

As an example, DLL Hell can occur when you install a new sofware program and the new program overwrites and existing DLL file with a newer version, but the newer version is not fully backwards compatible with the old, overwritten version, so one or more applications that use that DLL are broken.

This happened a lot before the .NET framework and I’ve been in DLL Hell a few times and it aint a place you want to be very often…

The .NET Framework effectively got rid of DLL Hell because we are given whats called the Global Assembly Cache and Side By Side Execution. (DLLs became known as Assemblies). You can load more than one version of an assembly and have them execute side by side. In a nutshell, I can do whatever I want with my assemblies, keep all my stuff together, and forget about you and what you do with your assemblies coz my stuff works and its all here and you can’t braek my stuff. Got it?

Well, heres the thing. I’ve just installed a couple of new programs on my system. Nice programs, popular programs. Then I go and run a different program and I get… dun dun daahhhh….

DLL HELL?

True, one of the new programs is a trial version but I shouldn’t get this. I had to reinstal one of my existing programs to get it to work. So something is broken somewhere in the food chain. This is the first time I have seen this and it aint good! Problem is, who do I contact? The component vendor?, program vendors?, the code police?

Sheesh

IT Works!

I’ve written somewhere on my website how I try to provide solutions that give a good return on my clients investment.

Unfortunately with Information Technology you don’t generally get any kind of feedback on the good stuff. You only hear when things are going wrong. That has a tendency to happen because the results are often difficult to quantify. Also, in a lot of cases, the client has no mechanisms in place for measuring any return or tracking results. So a lot of the time, we’re fighting an uphill battle.

However, I’ve recently been informed that software development projects that I’ve designed and built with one of my customers is producing MASSIVE growth within the company. This has been proved by the fact that they have rolled the system out for 5 new clients in the last few months. They have also committed to a large spend on new hardware and software upgrades and they are moving to new, bigger office complex where they will be leasing an entire floor. So their investment in IT solutions is paying off handsomely for them.

I’m so happy that they are seeing these benefits. Not just because it’s good for my reputation, but because it will hopefully inspire them to try more things with technology that will give them an even greater advantage over their competitors, provide more jobs at the company and allow them to help more people who user their business services too.

They are a student loan consolidation company based in Pinellas Park. We’ve rolled out some fairly leading edge technology using .NET, ASP.NET, web services, SQL server, SQL server reporting services and encryption.

The new client roll outs take less than 4 hours and they can effectively offer their services in this way, providing great leverage in their business with additional revenue streams built on what was initially a one off internal development project. However, as always, I tried to provide a reusable solution that could be pretty easily adapted and developed and that paid off too. That’s really a great benefit of developing for the Windows platform and using the .NET framework and related technologies.

So everyone’s happy! Neat!

Windows .NET, Web Services & Web Development

This project is going to be really interesting! It encompasses all of the following technologies and will no doubt be quite a challenge!

1. Windows .NET development (Windows Forms) 2. Encryption (3DES) 3. FTP 4. Website ASP.NET development 5. SQL Server Reporting Services 6. Secure Sockets Layer 7. XML Web Services

I don’t think i’ve missed anything. This is going to be a doozy!

Secure Black Box

As part of the specification for a new project, I am looking at a number of different vendors of encryption related technology products for the .NET framework.

The one I like best so far is Secure Black Box by Eldos Corp. It seems to have a good reputation and the documentation is good, which is important. The price is very respectable too!

I’ve downloaded a demo of the component to test and see how it performs.