Category Archives: Programming

Programming

ASP.Net load items – an efficient way to check for isDBNull to populate a control

This was the original way to check for a database field being null before putting it into a label:

if not isDBNull(dr(“FieldName”)) then

Me.label1.text = dr(“FieldName”).ToString

else

Me.label1.text = “”

end if

however there is a much better and more efficient way….

Me.label1.text = dr.field(of String)(“FieldName”)

Sorted!

Developing Applications in iOS Free eBook

I found these books online and thought I should re-post it as they took a lot of finding. According to the original post author where I downloaded these from the books are now free to distribute as they have been superseded by books about the new versions of iOS. If this original statement was in error, please contact me and I will ensure they are removed immediately.

Addison-Wesley Professional Programming in Objective-C 2.0 2nd

APress Learn Objective-C on the Mac

Checking for null when querying a datatable or dataview in ASP.Net (VB)

You can check for null when applying a select or a filter to a datatable or dataview it is easy to filter by a field that is equal to something, but much more difficult to check if it is null.

For example (dataview):

        Dim dv As DataView = Db.GetData("uspDatabaseMenuiser_Select").Tables(0).AsDataView
        dv.RowFilter = "ParentMenuID = 0"
        dv.Sort = "MenuTitle ASC"
          

As you can see from the rowFilter we are getting where ParentMenuID = 0, but what if we want to check if ParentMenuID is null?

        Dim dv As DataView = Db.GetData("uspDatabaseMenuiser_Select").Tables(0).AsDataView
        dv.RowFilter = "IsNull(ParentMenuID, '') <> ''"
        dv.Sort = "MenuTitle ASC"


					

Adobe Dreamweaver CS5.5 – Bugs Galore

So we have recently tried to start using Adobe Creative Suite CS5.5 on our new iMacs at work, and it is a complete disaster. Adobe Dreamweaver is so buggy that it can’t even open and close without crashing. Once open, it sometimes allows you to close it, and sometimes not. The Preferences menu seems to be permanently greyed out.

The Adobe forums appear to have hundreds of users with the same problems – cannot quit, no preferences and Adobe doing nothing. And people wonder why we still use Visual Studio 2010 on our Macs – because it is blooming brilliant in comparison to the Adobe rubbish!

Folder called Reports requires extra username and password?

We have had a recurring, and very annoying problem on some of our live servers – when trying to access any folder in IIS called “reports” it was asking for additional login information, and not showing the actual content from the folder. A bit of digging revealed that the culprit was SQL Server 2008 R2 Reporting Services.

Turning off Reporting Services didnt have any effect, we just got a 503 Error.

Resolution:

Click on Start

Type in Reporting Services Configuration Manager

Click on Report Manager URL on the left hand side of the Reporting Services Configuration Manager – by default it is set to “Reports”, as you can see here, we have already changed ours to “SQLReports”

Please leave a comment if this has helped you resolve the same problem we had!

Building your own website – the easy way

Lots of people ask me how to set up a personal or small business website that they can make themselves, so here is a simple step-by-step guide to do it cheaply and quickly.

1. Visit www.123-reg.co.uk and register your domain name of choice.

2. Visit www.brinkster.com and register for a choice of hosting package. You will probably have to wait for approx 4-8 hours for the account to be fully created.

3. On 123-reg control panel, open the details of the domain name, and choose “change nameservers”. Change the primary and secondary name servers to:

ns1.brinkster.com
ns2.brinkster.com

4. On Brinkster, log on to your new account and click on Support and then do a live chat to support. Ask them to add the domain name to your domain list of your account.

5. On Brinkster, open the website settings and then write down your FTP details

6. FTP (if you don’t have FTP software, leech FTP 1.3 is small and easy to use) the files up to your Brinkster space, and hey-presto – one fully working website :)

if this post has been useful or you would like more information, please leave a comment!

Firefox is now the odd one out….

Its very strange – in the past it was always Internet Explorer and its CSS rendering that was out of sync with all the other browsers, but now – shock horror – it is Firefox that is the nightmare browser!

I have been developing a new web-application called Infacture (www.infacture.co.uk) and it renders perfectly in IE 8 and 9, Safari on the PC, Safari on the Mac, Safari on the iPad and Google Chrome… yet in Firefox 4 it does something very strange with padding, and doesnt seem to have even basic CSS3 support like in IE9 and Safari.

Firefox’s rending of div’s and in particular putting padding on the outside rather than the inside, plus its seeming lack of knowledge about putting margin-top:auto; margin-bottom:auto; to provide perfect vertical centering is a disaster when it comes to cross-browser compatability. Its now at the point that I am considering saying that the app supports all browsers EXCEPT Firefox.

Firefox – get a move on, or you are going to get left behind!