RSS 2.0 | Atom 1.0 | CDF

Search

Categories

Archive

Blogroll

Sign In

# Wednesday, December 10, 2008
Wednesday, December 10, 2008 1:04:44 PM (GMT Standard Time, UTC+00:00) ( General )
great outlook macro to strip attachments from selected emails, darin archer's blog


Comments [0] | | # 
# Sunday, October 26, 2008
Sunday, October 26, 2008 1:41:10 PM (GMT Standard Time, UTC+00:00) ( Asp.Net | Windows Server 2003 )
IIS went down this morning after KB 958644 was isntalled automatically last night. My sites were showing "Service Unavailable"
there were several system event logs like so:
  • A process serving application pool '.Net 2.0 App Pool' suffered a fatal communication error with the World Wide Web Publishing Service. The process id was '2960'. The data field contains the error number.
  • Application pool '.Net 2.0 App Pool' is being automatically disabled due to a series of failures in the process(es) serving that application pool.

rebooting the server did not solve the problem.  so, on further research, KB article 885654 revealed the cause of the errors, lack of registry permissions for NETWORK SERVICE.  i hadn't changed any configuration on the server so assumed it was caused by a change in that windows update package.  i dug out ProcessMonitor and set up a registry filter for w3wp.exe where the Result was ACCESS DENIED.  there were about 50 entries during the time i enabled event capture and loaded up one of the sites that uses the affected application pool.  Most of them pointed to SystemCertificates entries.  I went through each one in regedit and gave NETWORK SERVICE full control where the process attempted to Create a key, and Read only access where the process attemped to Open the key.  worked fine then.

hope this helps someone out.
Comments [0] | | # 
# Thursday, October 16, 2008
Thursday, October 16, 2008 7:05:36 PM (GMT Daylight Time, UTC+01:00) ( .Net General )
thanks to Kev for his brilliant post about solving this problem, where you know you have the correct XPath expression but .Net is not giving you any nodes :(
his solution is the correct one, an alternative approach is to remove the xmlns from the root element before you load the XmlDocument so that you can use the default empty namespace (or something like that).

Comments [0] | | # 
# Wednesday, September 10, 2008
Wednesday, September 10, 2008 10:46:01 AM (GMT Daylight Time, UTC+01:00) ( Database )
say you wanted to change a BIT column to a NVARCHAR column, and the BIT column has a default value set to 0 or 1.  you can't run the following statement or you get a dependent object error.
alter table TABLE1 alter column COL1 NVarChar(MAX)
so i found this solution here, after you've run the query below, you can alter the column as above.

DECLARE @df SYSNAME
SET @df = 
 (SELECT OBJECT_NAME(cdefault) 
  FROM SYSCOLUMNS 
  WHERE id = OBJECT_ID('dbo.TABLE1') 
   AND name = 'COL1') 
IF @df IS NOT NULL 
 BEGIN 
  EXEC sp_rename @df, 'df_to_drop', 'OBJECT' 
  ALTER TABLE dbo.TABLE1 DROP CONSTRAINT df_to_drop 
 END

Comments [0] | | # 
# Wednesday, August 20, 2008
Wednesday, August 20, 2008 3:00:46 PM (GMT Daylight Time, UTC+01:00) ( .Net General )
i assumed that File.WriteAllText() would assume UTF8 encoding since all strings are unicode in .net by default, so i never bothered specifying the encoding in the 3rd parameter.  But it was causing me grief with accented characters, and i finally worked it out that i needed to specify UTF8 explicitly.
File.WriteAllText(filepath, text, Encoding.UTF8);

Comments [0] | | # 
# Thursday, July 17, 2008
Thursday, July 17, 2008 5:25:32 PM (GMT Daylight Time, UTC+01:00) ( .Net General | Asp.Net )
if you ever send a string across a web service, and write it out to a file, make sure you specify Encoding.UTF8 explicitly. otherwise characters such as the EURO symbol may not render correctly in some browsers (IE6).  it took me ages to pin this down, because everything i read about was about HTTP header charset values, or HTML document charsets, or database encodings.  In my case i was using the default encoding and this messed up EURO symbols. I suspect it is because of the string being serialized in the web service, but haven't the time to look into it any further.  it's fixed now anyhow.

Comments [3] | | # 
# Friday, May 09, 2008
Friday, May 09, 2008 12:40:24 PM (GMT Daylight Time, UTC+01:00) ( Database )
I don't know why this isn't part of the built-in functions, especially in sql 2005 but anyway, here it is thanks to this groups post:
CREATE FUNCTION Split(@String varchar(4000), @Delimiter char(1))
RETURNS @Results TABLE (ID int, Items nvarchar(4000))
AS

BEGIN
DECLARE @INDEX INT
DECLARE @SLICE nvarchar(4000)
DECLARE @ID int

SELECT @INDEX = 1, @ID = 1
WHILE @INDEX !=0

BEGIN
-- GET THE INDEX OF THE FIRST OCCURENCE OF THE SPLIT CHARACTER
SELECT @INDEX = CHARINDEX(@Delimiter,@STRING)
-- NOW PUSH EVERYTHING TO THE LEFT OF IT INTO THE SLICE VARIABLE
IF @INDEX !=0
SELECT @SLICE = LEFT(@STRING,@INDEX - 1)
ELSE
SELECT @SLICE = @STRING
-- PUT THE ITEM INTO THE RESULTS SET
INSERT INTO @Results(ID, Items) VALUES(@ID, @SLICE)
SELECT @ID = @ID + 1
-- CHOP THE ITEM REMOVED OFF THE MAIN STRING
SELECT @STRING = RIGHT(@STRING,LEN(@STRING) - @INDEX)
-- BREAK OUT IF WE ARE DONE
IF LEN(@STRING) = 0 BREAK
END
RETURN
Then you can do something like this:
select Items from dbo.Split(@List, ',')

Comments [6] | | # 
# Thursday, May 01, 2008
Thursday, May 01, 2008 4:09:52 PM (GMT Daylight Time, UTC+01:00) ( General )
Trying to get SonicWall Global VPN Client working on vista, i kept getting stuck at "Acquring IP".  Adding the program to the windows firewall made no difference, nor did opening port 443 as has been suggested by others.  What did work was disabling IPv6 on the virtual adapter. 
Start->Control Panel->Network and Internet->Network and Sharing Center->Mange network connections page. Select SonicWALL Virtual Adapter and right click on properties.  Untick IPv6 and you should be good to go.  i didn't have to configure my router or anything to get this to work.

Update Sept 2008

Install the latest client from Sonicwall and this problem goes away, the virtual network adapter is automatically disabled when not in use.
Comments [5] | | # 
# Friday, April 11, 2008
Friday, April 11, 2008 10:55:11 AM (GMT Daylight Time, UTC+01:00) ( Mobile )
there is a good post by Jim Wilson about configuring the Cellular Emulator with a Visual Studio emulator.  it wasn't immediately obvious to me why anyone would need 'another' emulator running at the same time, until i read that the Cellular Emulator is actually a virtual radio chip for the phone, so you can use the phone as if you were on a 2G or 3G connection, and track the GPRS byte usage.  the thing is, it wasn't really obvious (to me) how to get the data connection working. the answer is rather simple but i'm posting it here in case i forget.

You follow the steps outlined by Jim, and then go into the VS emulator and set up a new ISP connection, using "Cellular GPRS/3G", just like you would on a normal WM6 device.  use a blank APN, username and password and you're good to go.

Comments [0] | | # 
# Tuesday, April 08, 2008
Tuesday, April 08, 2008 4:27:37 PM (GMT Daylight Time, UTC+01:00) ( General )
powercfg -h off
run this as an administrator from the command prompt.  thanks to Mitch Tulloch for his post.

Comments [0] | | #