# Tuesday, February 16, 2010

Setup Single Sign-on for SharePoint 2007. The missing link

I need to use the SharePoint 2007 Single Sign-on service for the purposes of InfoPath Form authentication on Web Services.  I went through the Microsoft installation steps and immediately got

You do not have the rights to perform this operation.

A bit of googling later, and I found that this isn't uncommon. 

Looking at Dave Wollerman's post on the subject made me check everything again.

In the end the missing link (that I failed to read) from the Microsoft doc was simply that the Single Sign-on Windows service needed to be running with a domain account (I chose the same as the administrator accounts), and it then worked fine. 


posted on Tuesday, February 16, 2010 10:23:43 AM (AUS Eastern Daylight Time, UTC+11:00)  #    Comments [0]
# Wednesday, January 20, 2010

Deploying the minimum Oracle Instant Client files with ODP.NET

If you're looking for the smallest and least hassle deployment of Oracle client files with a .NET application, then forget about everything else you've been told - the following did the trick for me, and involves just 5 Oracle dll's.

Deploying ODP.NET with Oracle Instant client

One thing I found with this was that on my dev machine I already have (more than) one 'standard' Oracle installation and all the network config from that was really getting in the way meaning I couldn't connect for one reason or another - OR I was connecting, but not using the correct client, meaning deployed files wouldn't work on a 'virgin' machine.  All of this rather depends on how your company deploys Oracle server and clients I guess.

Rather than muck about with setting environment variables (that's so 80's) if you use a full connection string syntax as follows you can use your hostname and SID rather than try and fathom out service names. 

In your web.config

  <add name="MyDB" connectionString="Data Source=(DESCRIPTION = (ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = machinename)(PORT = 1521)))(CONNECT_DATA =(SID = mysid)));User Id=username;Password=password;" providerName="" />

Any other variation of the (mucho confusing) Oracle connection syntax just didn't work for me.

As an aside - I also kept getting System.OutOfMemoryException when building a web site project in Visual Studio 2008 when I was using the Oracle Basic client dll's (110mb +).  I switched to the smaller Basic 'Lite' versions and it was happy again.  I guess a single file of over 100mb blows the lid off the IDE.


posted on Wednesday, January 20, 2010 4:14:52 PM (AUS Eastern Daylight Time, UTC+11:00)  #    Comments [0]
# Monday, October 26, 2009

Deleting Registry values with a .reg file

Sometimes you just want to do something simple in a batch file, and I'd always thought it wasn't possible to 'delete' a value in a .reg file (as the file is applied as a 'merge'), but it is...

Just replace the value with a - (minus)...

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
"NoDriveTypeAutoRun"=-



posted on Monday, October 26, 2009 10:16:01 AM (AUS Eastern Daylight Time, UTC+11:00)  #    Comments [1]
# Friday, October 09, 2009

Software Developer vs Project Manager

I came across a hilarious (full of swearing) video the other day created through Xtranormal.com.  This amazing site gives you all the tools to just plug in a script and direct your own movie, along with amusing generated voices.

Here's my first effort to illustrate the sometimes rocky relationship between developers and project managers...

Watch on Xtranormal.com | Watch on Youtube
posted on Friday, October 09, 2009 10:33:55 PM (AUS Eastern Daylight Time, UTC+11:00)  #    Comments [0]
# Thursday, October 01, 2009

SQL Server - Insert to table with ALL default values

If you're trying to do an insert to a table where every column has a default value (or is an identity column), then SQL Server will give you an error if you don't specify 'something' in the field list/values clause... Or so I thought...

This is so simple it's funny, but not so simple to find in the documentation:

INSERT INTO TableName DEFAULT VALUES



posted on Thursday, October 01, 2009 9:01:02 AM (AUS Eastern Standard Time, UTC+10:00)  #    Comments [0]
# Monday, September 28, 2009

SQL Server Stored Procedure to disable / enable all foreign keys and constraints in a database

I've been doing a bit of batch archiving work, and needed a nice and quick way to disable foreign keys and other constraints without actually removing them.  I found a nice article on disabling all constraints in a database, and thought I'd just take it one step further by making it into a Stored Procedure, and adding a parameter to toggle whether the constraints are enabled or disabled.

Nice and easy.  Here's the script.


USE [YOURDBNAME]
GO

IF  EXISTS 
(SELECT FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[usp_SetDBTableConstraints]'AND type in (N'P'N'PC'))
DROP PROCEDURE dbo.usp_SetDBTableConstraints
GO

CREATE PROCEDURE 
dbo.usp_SetDBTableConstraints(@Enable BIT)

AS

/*** DISABLE/ENABLE ALL TABLE CONSTRAINTS ************************

This script will disable all constraints on all tables within the database
that it is run in.

************************************************************/

SET NOCOUNT ON
SET ROWCOUNT 


DECLARE @Count INT
DECLARE 
@String NVARCHAR (1000)
DECLARE @ConstraintName VARCHAR(128)
DECLARE @TableName VARCHAR(128)

--Find all constraints and their respective tables from the sysobjects table and place into a temp table.
--Primary Key and Unique Constraints via Unique Indexes are not disabled through this command
--You should use the ALTER INDEX...DISABLE command in SQL Server 2005
SELECT 
        name                     AS 
constraintname,
        object_name(parent_obj)  
AS tablename 
INTO #Const_Table
FROM sysobjects s 
where xtype in ('F')

SELECT @Count Count(*) FROM #Const_Table

--Setting the rowcount to one allows for one row from the temp table to be picked off at a time.
--Used as an alternative to a cursor.
SET ROWCOUNT 1

--Loop until all rows in temp table have been processed.
WHILE @Count > 0
BEGIN
    
--The rowcount of one ensures that only one tablename and constraint name is picked.
    
SELECT @TableName TableName, @ConstraintName ConstraintName
    
FROM #Const_Table

    
--Build execution string to disable constraint.
    
IF @Enable 
        
SET @String 'ALTER TABLE ['+ @tablename + '] CHECK CONSTRAINT [' + @constraintname +']'
    
ELSE
        SET 
@String 'ALTER TABLE ['+ @tablename + '] NOCHECK CONSTRAINT [' + @constraintname +']'

    
--Execute the SQL
    
EXEC sp_executesql @string

    
--Remove this row from the temp table, since it has now been processed.
    
DELETE FROM #Const_Table WHERE ConstraintName @ConstraintName and TableName @TableName

    
SET @Count @Count - 1
END -- Loop

SET ROWCOUNT 0

DROP TABLE #Const_Table
 

GO
posted on Monday, September 28, 2009 12:34:45 PM (AUS Eastern Standard Time, UTC+10:00)  #    Comments [0]
# Friday, August 14, 2009

Coder T-Shirts from Geek Casuals

OK - I do T-Shirts, and I'm just plugging my more geeky brand 'Geek Casuals', but some of these may appeal to the .NET audience....





Geek Casuals - Geekwear that geeks wear..


posted on Friday, August 14, 2009 8:43:12 AM (AUS Eastern Standard Time, UTC+10:00)  #    Comments [1]
# Monday, July 20, 2009

Remote Desktop Clipboard Not Working? - Just restart rdpclip

This one's been bugging me for years.  You know the situation, you're happily using a remote desktop connection, and all of a sudden the clipboard stops working for no apparent reason.

I recently stumbled across a 'fix' for this.  It's more of a workaround than a fix, as you'll need to do it every time the clipboard disappears.

Just look for a process named rdpclip.exe on the machine you're remoting to, and kill it, then restart it.

You should find you're able to copy/paste again. 

posted on Monday, July 20, 2009 12:01:17 PM (AUS Eastern Standard Time, UTC+10:00)  #    Comments [0]