ShowUsYour<Blog>
Irregular expressions regularly
-
Change the owner of all db objects
It was after running the sql scripts to install a new database that I noticed that the author had not prefixed the objects with "dbo." and so, after running them I noticed that they were owned by the user that I was logged-in as at the time (super_administrator!). Well, it wasn't going to be very useful to have everyone logging in using that account to run the sprocs so, I wrote the following script to enumerate the tables and sprocs and assign a new owner:
DECLARE @currentObject nvarchar(517) DECLARE @qualifiedObject nvarchar(517) DECLARE @currentOwner varchar(50) DECLARE @newOwner varchar(50) SET @currentOwner = 'ASPNET' SET @newOwner = 'dbo' DECLARE alterOwnerCursor CURSOR FOR SELECT [name] FROM dbo.sysobjects WHERE xtype = 'U' or xtype = 'P' AND LEFT([name], 2) <> 'dt' OPEN alterOwnerCursor FETCH NEXT FROM alterOwnerCursor INTO @currentObject WHILE @@FETCH_STATUS = 0 BEGIN SET @qualifiedObject = CAST(@currentOwner as varchar) + '.' + CAST(@currentObject as varchar) EXEC sp_changeobjectowner @qualifiedObject, @newOwner FETCH NEXT FROM alterOwnerCursor INTO @currentObject END CLOSE alterOwnerCursor DEALLOCATE alterOwnerCursor
-
XmlComment syntax for VB
Where I am at the moment we use:
'/
for XMLCommenting syntax. Originally there was some mention that, when the VB team add support for XmlComment'ing they would adopt'@
as the syntax whereas, Paul Vick has just confirmed that it will most likely end as'''
. As a friend once said to me: Syntax I care zippo about but semantics, that's different! -
Regulator and RegexLib webservices
-
Dim a : VB Is Not a TypeOf Misanthropy
After copping a bit of a bollocking at the hands of the masses the other day, Paul Vick has thrown out some reasonably insightful diatribe regarding proposed code re-writing functionality which is slated for inclusion in an already feature rich IDE.
-
Useful Custom Controls for WebForms
I've been lucky enough to have quite a bit of exposure to Custom Controls of late and thought that I'd make a short note about the usefulness of them.
-
Will VB have the yield keyword?
It appears that the VB team are deciding whether or not to give the world access to some code re-writing functionality that has become loosely known throughout the programming world as "code refactoring". This is a feature where you can ask the IDE to invoke a macro on a section of code rather than having to perform the arduous 3 or 4 steps manually. The thing is that they've decided that their target user either won't understand or (perhaps) will be scared off by the term "Refactor" so, they would propose to call the Refactor function something other than “Refactor” - similar to when they called Partial classes something other than “Partial” I suppose.
-
ComponentOneGoodies.Install()
Had this query from a member of our UserGroup today:
-
Mark the PDC
Many major events are marked by a single, significant milestone, remark or activity. Major moments such as these linger in our minds and allow us bookmark points in our past so that we can relive them in the future. Often, a trip to a bookmarked moment will stir feelings and emotions from that time.
-
Getting to the source of the Windows.Forms.DataGrid
People that know me well know that - essentially - I'm a web guy. Gimme notepad, and a browser and I'm away. Anyways, in the past year or so I've stepped into more and more WinForms development (for many reasons) and, despite my elevation from WinForms wannabe to WinForms wiz I've continually been scared off by the DataGrid control... NOT ANY MORE!
-
Compute is not a cultured method
Even though, in the constructor for my WinForms app I do this...