Wednesday, 23 September 2009

Public DNS servers

If you or your clients ever seem to be having DNS problems, then try switching DNS settings to ones provided by OpenDNS.

Their nameservers are 208.67.222.222 and 208.67.220.220

Thursday, 17 September 2009

Validation groups in my add/edit ListView

A schoolboy error this one - I created a ListView and made the InsertItemPosition the footer row, enabled editing, and everything was working great. Then I added some requiredfieldvalidators to my edit and insert fields. Then there was a problem, I couldn't make an edit without the validator triggering on the insert fields, despite the input fields being named differently and the validators assigned accordingly. And then I remembered the ValidationGroup attribute, which by default doesn't appear in your validator.

To link a validator to an action, simply assign the same ValidationGroup attribute to the button and the validator.

Thursday, 10 September 2009

Adding a foreign key - SQL Server

I confess to sometimes not using foreign keys when really I should be. Well now I have no excuse for forgetting how to implement them:

ALTER TABLE Orders 
ADD FOREIGN KEY (customerid) REFERENCES Customer;

Tuesday, 1 September 2009

Changing table owner in SQL 2000

Note to self, so next time I dont' have to Google it:
EXEC dbo.sp_changeobjectowner @objname = 'Test.TestTable' , @newowner = 'dbo'