Just in case you can find SqlHelper.cs which comes in Data Access Application Block for .NET v2.
Most articles and posts about the “C# vs VB.NET” argument conclude that the two languages are equal and only differ slightly. Although I agree with this I think the real difference is not the syntax of these languages but the way they are implemented. After 9 months of using VB.NET (on someone eles’s app) I have found that old school VB developers cannot let go of classic VB and have not embraced the power of .NET.
Read the rest of this entry »
In this HOWTO I will explain how to generate XPath expressions using a simple XML Document, a custom object collection and a few foreach loops. The end result is a list of XPath expressions that map to each node of the specified XML Document. This can be very useful for XML that is large or XML you are not familiar with but is does begin to fall apart when you get into very complext XML.
This HOWTO was a specific requirement of my job so I can’t go into to great detail nor-can I give you all of the source code. What I am going to cover is building an XSS filter to use in your ASP.NET app.
One of the biggest problems facing every single person that uses the internet is Cross Site Scripting (XSS) exploits. XSS come from our Love/Hate relationship with JavaScript. On one hand through JavaScript we can implement quick interaction with users of our web apps through dialog boxes alerts. JavaScript also gives us cool image effects, client-side form validation and now the holy grail of Ajax.
But the hate of JavaScript is its weak security and its ability to access the machine the browser is running on. If a developer is not careful that could expose their users to a whole world of hurt.
Over the past few months I have been toying with Ajax and .NET via the Ajax.NET Professional Library and my first few attempts left me feeling that Ajax was not very useful. Then I recently had a specific task to complete and it seemed to be a perfect candidate for Ajax. The task was very simple, get a list of Albums by an Artist. This functionality is of course part of a much larger on-line music app I was constructing but I needed to start with something small. The UI was very simple a TextBox to enter an Artists’ Name and a Table to display the Albums. Since this was such a simple task I decided to spice it up with some AJAX.
Read the rest of this entry »