<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>beauchamp.me</title>
	<atom:link href="http://www.beauchamp.me/techno/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.beauchamp.me/techno</link>
	<description>Technical Stuff...</description>
	<lastBuildDate>Thu, 17 May 2012 16:05:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Could not load file or assembly ‘PresentationCore’ or one of its dependencies. An attempt was made to load a program with an incorrect format.</title>
		<link>http://www.beauchamp.me/techno/aspnet/could-not-load-file-or-assembly-%e2%80%98presentationcore%e2%80%99-or-one-of-its-dependencies-an-attempt-was-made-to-load-a-program-with-an-incorrect-format/</link>
		<comments>http://www.beauchamp.me/techno/aspnet/could-not-load-file-or-assembly-%e2%80%98presentationcore%e2%80%99-or-one-of-its-dependencies-an-attempt-was-made-to-load-a-program-with-an-incorrect-format/#comments</comments>
		<pubDate>Wed, 23 Nov 2011 14:37:10 +0000</pubDate>
		<dc:creator>jf</dc:creator>
				<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://www.beauchamp.me/techno/?p=180</guid>
		<description><![CDATA[After copying a web site to a 64bit server with IIS 7, I was getting the following error message: Could not load file or assembly ‘PresentationCore’ or one of its dependencies. An attempt was made to load a program with an incorrect format. although everything was working fine when running the site on my machine [...]]]></description>
			<content:encoded><![CDATA[<p>After copying a web site to a 64bit server with IIS 7, I was getting the following error message:</p>
<pre class="brush:plain">Could not load file or assembly ‘PresentationCore’ or one of its dependencies. An attempt was made to load a program with an incorrect format.</pre>
<p>although everything was working fine when running the site on my machine (32bit WinXP with IIS 6).</p>
<p>I did some research, and some people suggested to turn on &#8220;Enable 32-bit Applications&#8221; in my web site application pool advanced property. However, I was not satisfied with that answer. All my DLL&#8217;s were supposed to be compatible with 64-bit, so I did not see why I should turn on that setting.</p>
<p>One thing I have to mention here is that I was using MSBUILD to compile my web application on the server with a line like:</p>
<pre class="brush:plain">C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Msbuild.exe Extranet.csproj /t:Build</pre>
<p>After much researching, I noticed that each time the project was compiled with the line above, two files were added to the bin directory of my web application:</p>
<ul>
<li>PresentationCore.dll</li>
<li>System.Printing.dll</li>
</ul>
<p>I never added these files to the project, and I did not reference them either. They were added automatically by MSBuild every time I would compile. This was the culprit. After doing more investigation, I discovered that if I compiled with the proper version of MsBuild, this did not happen anymore. So I changed my compiling line above for this one and everything was fine or almost:</p>
<pre class="brush:plain">c:\Windows\Microsoft.NET\Framework64\v3.5\MSBuild.exe Extranet.csproj /t:Build</pre>
<p>Notice the changes: Framework -&gt; Framework64 and v2.0.50727 -&gt; v3.5.</p>
<p>Earlier, I said that using that version of MsBuild solves everything or <strong><em>almost</em></strong> because I then got some compilation errors, but they are easy to fix. I did not have Visual Studio installed on the server, so two sets of files were missing for the compilation to succede. The compiler was complaining about WebAppications.targets and WebProfileBuilder.targets. If this happens, you can simply copy the follwoing folders from a machine where you have Visual Studio installed to your server:</p>
<ul>
<li>C:\Program Files\MSBuild\Microsoft\VisualStudio\v9.0\WebAppications</li>
<li>C:\Program Files\MSBuild\WebProfileBuilder</li>
</ul>
<p>After doing so, everything complied fine, and I did not have any complaint about PresentationCore anymore.</p>
<p>Hope this helps!</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.beauchamp.me/techno/aspnet/could-not-load-file-or-assembly-%e2%80%98presentationcore%e2%80%99-or-one-of-its-dependencies-an-attempt-was-made-to-load-a-program-with-an-incorrect-format/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Output the call stack in C#</title>
		<link>http://www.beauchamp.me/techno/c/output-the-call-stack-in-c/</link>
		<comments>http://www.beauchamp.me/techno/c/output-the-call-stack-in-c/#comments</comments>
		<pubDate>Tue, 22 Nov 2011 21:52:43 +0000</pubDate>
		<dc:creator>jf</dc:creator>
				<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://www.beauchamp.me/techno/?p=176</guid>
		<description><![CDATA[Here is the code I use in C# to output the Call Stack. In this example, I am using log4net to output each line in a log file, but it would be possible to use Writeln or another logging library: log4net.ILog logger = log4net.LogManager.GetLogger("File"); logger.Debug("Call stack:"); StackTrace st = new StackTrace(true); for (int i = [...]]]></description>
			<content:encoded><![CDATA[<p>Here is the code I use in C# to output the Call Stack. In this example, I am using log4net to output each line in a log file, but it would be possible to use Writeln or another logging library:</p>
<pre class="brush:csharp">            log4net.ILog logger = log4net.LogManager.GetLogger("File");
            logger.Debug("Call stack:");

            StackTrace st = new StackTrace(true);
            for (int i = 0; i &lt; st.FrameCount; i++)
            {
                // Note that high up the call stack, there is only
                // one stack frame.
                StackFrame sf = st.GetFrame(i);
                logger.Debug(string.Format("{0} ({1}): {2}", sf.GetFileName(), sf.GetFileLineNumber().ToString(), sf.GetMethod()));
            }           

            application.EndRequest += new EventHandler(OnEndRequest);

            logger.Debug("End of Call Stack");</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.beauchamp.me/techno/c/output-the-call-stack-in-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Duplicate a database with SQL Server Express 2008</title>
		<link>http://www.beauchamp.me/techno/sql-server-2008/duplicate-a-database-with-sql-server-express-2008/</link>
		<comments>http://www.beauchamp.me/techno/sql-server-2008/duplicate-a-database-with-sql-server-express-2008/#comments</comments>
		<pubDate>Fri, 02 Sep 2011 21:16:42 +0000</pubDate>
		<dc:creator>jf</dc:creator>
				<category><![CDATA[SQL Server 2008]]></category>

		<guid isPermaLink="false">http://www.beauchamp.me/techno/?p=170</guid>
		<description><![CDATA[Following my previous post, here is the same script for SQL Server Express 2008: USE master GO -- the original database (use 'SET @DB = NULL' to disable backup) DECLARE @DB varchar(200) SET @DB = 'MyDB' -- the backup filename DECLARE @BackupFile varchar(2000) SET @BackupFile = 'c:\temp\mydb.dat' -- the new database name DECLARE @TestDB varchar(200) [...]]]></description>
			<content:encoded><![CDATA[<p>Following my <a title="Duplicating a database in SQL Server Express" href="http://www.beauchamp.me/techno/sql-server-2005/duplicating-a-database-in-sql-server-express/">previous post</a>, here is the same script for SQL Server Express 2008:</p>
<pre class="brush:sql">USE master
GO

-- the original database (use 'SET @DB = NULL' to disable backup)
DECLARE @DB varchar(200)
SET @DB = 'MyDB'

-- the backup filename
DECLARE @BackupFile varchar(2000)
SET @BackupFile = 'c:\temp\mydb.dat'

-- the new database name
DECLARE @TestDB varchar(200)
SET @TestDB = 'MyDbCopy'

-- the new database files without .mdf/.ldf
DECLARE @RestoreFile varchar(2000)
SET @RestoreFile = 'c:\temp\MyDbCopy'

-- ****************************************************************
--                    no change below this line
-- ****************************************************************

DECLARE @query varchar(2000)

DECLARE @DataFile varchar(2000)
SET @DataFile = @RestoreFile + '.mdf'

DECLARE @LogFile varchar(2000)
SET @LogFile = @RestoreFile + '.ldf'

IF @DB IS NOT NULL
BEGIN
    SET @query = 'BACKUP DATABASE ' + @DB + ' TO DISK = ' + QUOTENAME(@BackupFile, '''')
    EXEC (@query)
END

-- RESTORE FILELISTONLY FROM DISK = 'C:\temp\backup.dat'
-- RESTORE HEADERONLY FROM DISK = 'C:\temp\backup.dat'
-- RESTORE LABELONLY FROM DISK = 'C:\temp\backup.dat'
-- RESTORE VERIFYONLY FROM DISK = 'C:\temp\backup.dat'

IF EXISTS(SELECT * FROM sysdatabases WHERE name = @TestDB)
BEGIN
    SET @query = 'DROP DATABASE ' + @TestDB
    EXEC (@query)
END

SET @query = 'RESTORE HEADERONLY FROM DISK = ' + QUOTENAME(@BackupFile , '''')

RESTORE HEADERONLY FROM DISK = 'c:\temp\mydb.dat'
CREATE TABLE #restoreheader
(
    BackupName  nvarchar(128)
,   BackupDescription   nvarchar(255)
,   BackupType  smallint
,   ExpirationDate  datetime
,   Compressed  tinyint
,   Position    smallint
,   DeviceType  tinyint
,   UserName    nvarchar(128)
,   ServerName  nvarchar(128)
,   DatabaseName    nvarchar(128)
,   DatabaseVersion int
,   DatabaseCreationDate    datetime
,   BackupSize  numeric(20,0)
,   FirstLSN    numeric(25,0)
,   LastLSN numeric(25,0)
,   CheckpointLSN   numeric(25,0)
,   DatabaseBackupLSN   numeric(25,0)
,   BackupStartDate datetime
,   BackupFinishDate    datetime
,   SortOrder   smallint
,   CodePage    smallint
,   UnicodeLocaleId int
,   UnicodeComparisonStyle  int
,   CompatibilityLevel  tinyint
,   SoftwareVendorId    int
,   SoftwareVersionMajor    int
,   SoftwareVersionMinor    int
,   SoftwareVersionBuild    int
,   MachineName nvarchar(128)
,   Flags   int
,   BindingID   uniqueidentifier
,   RecoveryForkID  uniqueidentifier
,   Collation   nvarchar(128)
,   FamilyGUID  uniqueidentifier
,   HasBulkLoggedData   bit
,   IsSnapshot  bit
,   IsReadOnly  bit
,   IsSingleUser    bit
,   HasBackupChecksums  bit
,   IsDamaged   bit
,   BeginsLogChain  bit
,   HasIncompleteMetaData   bit
,   IsForceOffline  bit
,   IsCopyOnly  bit
,   FirstRecoveryForkID uniqueidentifier
,   ForkPointLSN    numeric(25,0) NULL
,   RecoveryModel   nvarchar(60)
,   DifferentialBaseLSN numeric(25,0) NULL
,   DifferentialBaseGUID    uniqueidentifier
,   BackupTypeDescription   nvarchar(60)
,   BackupSetGUID   uniqueidentifier NULL
,	CompressedBackupSize int
)
INSERT #restoreheader EXEC (@query)

DECLARE @File int
SELECT @File=COUNT(*) FROM #restoreheader
PRINT '@File: ' + CAST(@File AS VARCHAR(2))

TRUNCATE TABLE #restoreheader
DROP TABLE #restoreheader

DECLARE @Data varchar(500)
DECLARE @Log varchar(500)

SET @query = 'RESTORE FILELISTONLY FROM DISK = ' + QUOTENAME(@BackupFile , '''')

CREATE TABLE #restoretemp
(
    LogicalName  nvarchar(128)
,   PhysicalName     nvarchar(260)
,   Type     char(1)
,   FileGroupName    nvarchar(128)
,   Size     numeric(20,0)
,   MaxSize  numeric(20,0)
,   FileID   bigint
,   CreateLSN    numeric(25,0)
,   DropLSN  numeric(25,0) NULL
,   UniqueID     uniqueidentifier
,   ReadOnlyLSN  numeric(25,0) NULL
,   ReadWriteLSN     numeric(25,0) NULL
,   BackupSizeInBytes    bigint
,   SourceBlockSize  int
,   FileGroupID  int
,   LogGroupGUID     uniqueidentifier NULL
,   DifferentialBaseLSN  numeric(25,0) NULL
,   DifferentialBaseGUID     uniqueidentifier
,   IsReadOnly   bit
,   IsPresent    bit
,	TDEThumbprint	varbinary(32)
)
INSERT #restoretemp EXEC (@query)

SELECT @Data = LogicalName FROM #restoretemp WHERE type = 'D'
SELECT @Log = LogicalName FROM #restoretemp WHERE type = 'L'

PRINT '@Data: ' + @Data
PRINT '@Log: ' + @Log

TRUNCATE TABLE #restoretemp
DROP TABLE #restoretemp

IF @File &gt; 0
BEGIN
    SET @query = 'RESTORE DATABASE ' + @TestDB + ' FROM DISK = ' + QUOTENAME(@BackupFile, '''') +
        ' WITH MOVE ' + QUOTENAME(@Data, '''') + ' TO ' + QUOTENAME(@DataFile, '''') + ', MOVE ' +
        QUOTENAME(@Log, '''') + ' TO ' + QUOTENAME(@LogFile, '''') + ', FILE = ' + CONVERT(varchar, @File)
    EXEC (@query)
END
GO</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.beauchamp.me/techno/sql-server-2008/duplicate-a-database-with-sql-server-express-2008/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Duplicating a database in SQL Server Express</title>
		<link>http://www.beauchamp.me/techno/sql-server-2005/duplicating-a-database-in-sql-server-express/</link>
		<comments>http://www.beauchamp.me/techno/sql-server-2005/duplicating-a-database-in-sql-server-express/#comments</comments>
		<pubDate>Sat, 13 Aug 2011 03:07:54 +0000</pubDate>
		<dc:creator>jf</dc:creator>
				<category><![CDATA[SQL Server 2005]]></category>

		<guid isPermaLink="false">http://www.beauchamp.me/techno/?p=167</guid>
		<description><![CDATA[With SQL Server Standard Edition and above, it is easy to copy a database. You simply have to right-click on its name, select Tasks and select Copy Database&#8230; However that menu item is not there in SQL Server Express. Googling for a solution, I found a script that does just that, but it was written [...]]]></description>
			<content:encoded><![CDATA[<p>With SQL Server Standard Edition and above, it is easy to copy a database. You simply have to right-click on its name, select Tasks and select Copy Database&#8230; However that menu item is not there in SQL Server Express. Googling for a solution, I found a script that does just that, but it was written for SQL Server 2000. So I decided to fix it so that it works with SQK Server 2005 (<del>I haven&#8217;t tested it with 2008</del> <a title="SQL Server Express 2008" href="http://www.beauchamp.me/techno/uncategorized/duplicate-a-database-with-sql-server-express-2008/">Here is the script for SQL Server Express 2008</a>).</p>
<p>Here you will find the original script:</p>
<p><a href="http://weblogs.asp.net/mschwarz/archive/2004/08/26/220735.aspx">http://weblogs.asp.net/mschwarz/archive/2004/08/26/220735.aspx</a></p>
<p>And here is the modified script that will run on SQL Server 2005</p>
<pre class="brush:sql">USE master
GO

-- the original database (use 'SET @DB = NULL' to disable backup)
DECLARE @DB varchar(200)
SET @DB = 'MyDB'

-- the backup filename
DECLARE @BackupFile varchar(2000)
SET @BackupFile = 'c:\temp\mydb.dat'

-- the new database name
DECLARE @TestDB varchar(200)
SET @TestDB = 'MyDbCopy'

-- the new database files without .mdf/.ldf
DECLARE @RestoreFile varchar(2000)
SET @RestoreFile = 'c:\temp\MyDbCopy'

-- ****************************************************************
--                    no change below this line
-- ****************************************************************

DECLARE @query varchar(2000)

DECLARE @DataFile varchar(2000)
SET @DataFile = @RestoreFile + '.mdf'

DECLARE @LogFile varchar(2000)
SET @LogFile = @RestoreFile + '.ldf'

IF @DB IS NOT NULL
BEGIN
    SET @query = 'BACKUP DATABASE ' + @DB + ' TO DISK = ' + QUOTENAME(@BackupFile, '''')
    EXEC (@query)
END

-- RESTORE FILELISTONLY FROM DISK = 'C:\temp\backup.dat'
-- RESTORE HEADERONLY FROM DISK = 'C:\temp\backup.dat'
-- RESTORE LABELONLY FROM DISK = 'C:\temp\backup.dat'
-- RESTORE VERIFYONLY FROM DISK = 'C:\temp\backup.dat'

IF EXISTS(SELECT * FROM sysdatabases WHERE name = @TestDB)
BEGIN
    SET @query = 'DROP DATABASE ' + @TestDB
    EXEC (@query)
END

SET @query = 'RESTORE HEADERONLY FROM DISK = ' + QUOTENAME(@BackupFile , '''')

CREATE TABLE #restoreheader
(
	BackupName	nvarchar(128)
,	BackupDescription	nvarchar(255)
,	BackupType	smallint
,	ExpirationDate	datetime
,	Compressed	tinyint
,	Position	smallint
,	DeviceType	tinyint
,	UserName	nvarchar(128)
,	ServerName	nvarchar(128)
,	DatabaseName	nvarchar(128)
,	DatabaseVersion	int
,	DatabaseCreationDate	datetime
,	BackupSize	numeric(20,0)
,	FirstLSN	numeric(25,0)
,	LastLSN	numeric(25,0)
,	CheckpointLSN	numeric(25,0)
,	DatabaseBackupLSN	numeric(25,0)
,	BackupStartDate	datetime
,	BackupFinishDate	datetime
,	SortOrder	smallint
,	CodePage	smallint
,	UnicodeLocaleId	int
,	UnicodeComparisonStyle	int
,	CompatibilityLevel	tinyint
,	SoftwareVendorId	int
,	SoftwareVersionMajor	int
,	SoftwareVersionMinor	int
,	SoftwareVersionBuild	int
,	MachineName	nvarchar(128)
,	Flags	int
,	BindingID	uniqueidentifier
,	RecoveryForkID	uniqueidentifier
,	Collation	nvarchar(128)
,	FamilyGUID	uniqueidentifier
,	HasBulkLoggedData	bit
,	IsSnapshot	bit
,	IsReadOnly	bit
,	IsSingleUser	bit
,	HasBackupChecksums	bit
,	IsDamaged	bit
,	BeginsLogChain	bit
,	HasIncompleteMetaData	bit
,	IsForceOffline	bit
,	IsCopyOnly	bit
,	FirstRecoveryForkID	uniqueidentifier
,	ForkPointLSN	numeric(25,0) NULL
,	RecoveryModel	nvarchar(60)
,	DifferentialBaseLSN	numeric(25,0) NULL
,	DifferentialBaseGUID	uniqueidentifier
,	BackupTypeDescription	nvarchar(60)
,	BackupSetGUID	uniqueidentifier NULL
)
INSERT #restoreheader EXEC (@query)

DECLARE @File int
SELECT @File=COUNT(*) FROM #restoreheader
PRINT '@File: ' + CAST(@File AS VARCHAR(2))

TRUNCATE TABLE #restoreheader
DROP TABLE #restoreheader

DECLARE @Data varchar(500)
DECLARE @Log varchar(500)

SET @query = 'RESTORE FILELISTONLY FROM DISK = ' + QUOTENAME(@BackupFile , '''')

CREATE TABLE #restoretemp
(
	LogicalName	 nvarchar(128)
,	PhysicalName	 nvarchar(260)
,	Type	 char(1)
,	FileGroupName	 nvarchar(128)
,	Size	 numeric(20,0)
,	MaxSize	 numeric(20,0)
,	FileID	 bigint
,	CreateLSN	 numeric(25,0)
,	DropLSN	 numeric(25,0) NULL
,	UniqueID	 uniqueidentifier
,	ReadOnlyLSN	 numeric(25,0) NULL
,	ReadWriteLSN	 numeric(25,0) NULL
,	BackupSizeInBytes	 bigint
,	SourceBlockSize	 int
,	FileGroupID	 int
,	LogGroupGUID	 uniqueidentifier NULL
,	DifferentialBaseLSN	 numeric(25,0) NULL
,	DifferentialBaseGUID	 uniqueidentifier
,	IsReadOnly	 bit
,	IsPresent	 bit
)
INSERT #restoretemp EXEC (@query)

SELECT @Data = LogicalName FROM #restoretemp WHERE type = 'D'
SELECT @Log = LogicalName FROM #restoretemp WHERE type = 'L'

PRINT '@Data: ' + @Data
PRINT '@Log: ' + @Log

TRUNCATE TABLE #restoretemp
DROP TABLE #restoretemp

IF @File &gt; 0
BEGIN
    SET @query = 'RESTORE DATABASE ' + @TestDB + ' FROM DISK = ' + QUOTENAME(@BackupFile, '''') +
        ' WITH MOVE ' + QUOTENAME(@Data, '''') + ' TO ' + QUOTENAME(@DataFile, '''') + ', MOVE ' +
        QUOTENAME(@Log, '''') + ' TO ' + QUOTENAME(@LogFile, '''') + ', FILE = ' + CONVERT(varchar, @File)
    EXEC (@query)
END
GO</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.beauchamp.me/techno/sql-server-2005/duplicating-a-database-in-sql-server-express/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iSync disappeared in OS X Lion</title>
		<link>http://www.beauchamp.me/techno/mac/isync-disappeared-in-os-x-lion/</link>
		<comments>http://www.beauchamp.me/techno/mac/isync-disappeared-in-os-x-lion/#comments</comments>
		<pubDate>Fri, 22 Jul 2011 04:34:47 +0000</pubDate>
		<dc:creator>jf</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://www.beauchamp.me/techno/?p=161</guid>
		<description><![CDATA[I was really pissed when I realized that iSync had disappeared after upgrading to OS X Lion. Suddenly, I had no mean to synchronize my cellular phone with my computer. I find this type of attitude very rude from Apple. Well, by chance I did not really upgrade. In fact, I installed OS X Lion [...]]]></description>
			<content:encoded><![CDATA[<p>I was really pissed when I realized that iSync had disappeared after upgrading to OS X Lion. Suddenly, I had no mean to synchronize my cellular phone with my computer. I find this type of attitude very rude from Apple. Well, by chance I did not really upgrade. In fact, I installed OS X Lion on a new drive that I installed in my Macbook Pro. And I was keeping my old drive with OS X Snow Leopard as backup in case something goes wrong with the new drive or with Lion. The solution was to simply copy iSync from the Applications folder on my old drive to the same folder on my new drive. So now I have Lion with iSync.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.beauchamp.me/techno/mac/isync-disappeared-in-os-x-lion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Permission problem to run msdb.dbo.sp_send_dbmail</title>
		<link>http://www.beauchamp.me/techno/sql-server-2005/permission-problem-to-run-msdb-dbo-sp_send_dbmail/</link>
		<comments>http://www.beauchamp.me/techno/sql-server-2005/permission-problem-to-run-msdb-dbo-sp_send_dbmail/#comments</comments>
		<pubDate>Mon, 18 Jul 2011 16:35:34 +0000</pubDate>
		<dc:creator>jf</dc:creator>
				<category><![CDATA[SQL Server 2005]]></category>

		<guid isPermaLink="false">http://www.beauchamp.me/techno/?p=156</guid>
		<description><![CDATA[I needed to be able to send emails from a stored procedure using something like EXECUTE msdb.dbo.sp_send_dbmail @recipients='address@domainname.com', @subject = 'Test email', @body = 'Test email body' The solution was to add the user I was using to run the above query to the msdb database and to assign the role DatabaseMailUserRole to the user: [...]]]></description>
			<content:encoded><![CDATA[<p>I needed to be able to send emails from a stored procedure using something like</p>
<pre class="brush:sql">EXECUTE msdb.dbo.sp_send_dbmail @recipients='address@domainname.com',
@subject = 'Test email',
@body = 'Test email body'
</pre>
<p>The solution was to add the user I was using to run the above query to the msdb database and to assign the role DatabaseMailUserRole to the user:</p>
<pre class="brush:sql">EXEC msdb.dbo.sp_addrolemember @rolename = 'DatabaseMailUserRole'
    ,@membername = 'myUserName';</pre>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.beauchamp.me/techno/sql-server-2005/permission-problem-to-run-msdb-dbo-sp_send_dbmail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unable to turn on or off AirPort solved</title>
		<link>http://www.beauchamp.me/techno/mac/unable-to-turn-on-or-off-airport-solved/</link>
		<comments>http://www.beauchamp.me/techno/mac/unable-to-turn-on-or-off-airport-solved/#comments</comments>
		<pubDate>Wed, 18 May 2011 16:34:16 +0000</pubDate>
		<dc:creator>jf</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://www.beauchamp.me/techno/?p=150</guid>
		<description><![CDATA[Recently, I was unable anymore to turn off AirPort on my Macbook Pro. Other people reported having the same problem, and it seems related to Snow Leopard. Some people had the reverse problem: They were not able to turn on AirPort. Here is the solution that worked for me: Open the following folder: /Library/Preferences/SystemConfiguration Delete these [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I was unable anymore to turn off AirPort on my Macbook Pro. Other people reported having the same problem, and it seems related to Snow Leopard. Some people had the reverse problem: They were not able to turn on AirPort. Here is the solution that worked for me:</p>
<ul>
<li>Open the following folder: /Library/Preferences/SystemConfiguration</li>
<li>Delete these files: com.apple.airport.preferences.plist, NetworkInterfaces.plist and preferences.plist</li>
<li>Reboot your Mac</li>
</ul>
<p>I found this solution <a title="here" href="https://discussions.apple.com/thread/2132818?start=30&amp;tstart=0" target="_blank">here</a>, and it worked for me. <a title="Here" href="http://forums.macrumors.com/showthread.php?t=777038&amp;page=2" target="_blank">Here</a> is another similar solution in case the one I used does not work.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.beauchamp.me/techno/mac/unable-to-turn-on-or-off-airport-solved/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What process is causing DISK I/O</title>
		<link>http://www.beauchamp.me/techno/mac/what-process-is-causing-disk-io/</link>
		<comments>http://www.beauchamp.me/techno/mac/what-process-is-causing-disk-io/#comments</comments>
		<pubDate>Fri, 06 May 2011 14:58:11 +0000</pubDate>
		<dc:creator>jf</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://www.beauchamp.me/techno/?p=145</guid>
		<description><![CDATA[Sometimes, there is a lot of activity on my Macbook Pro drive, and I would like to find out what is causing all these Disk I/O&#8217;s. I found this thread that can help: http://superuser.com/questions/89266/whats-causing-all-the-disk-activity-on-os-x There are two suggestions on that thread. Either using &#8216;iotop -C 5 12' or using 'fs_usage'. What I would like to [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes, there is a lot of activity on my Macbook Pro drive, and I would like to find out what is causing all these Disk I/O&#8217;s. I found this thread that can help:</p>
<p><a title="http://superuser.com/questions/89266/whats-causing-all-the-disk-activity-on-os-x" href="http://superuser.com/questions/89266/whats-causing-all-the-disk-activity-on-os-x" target="_blank">http://superuser.com/questions/89266/whats-causing-all-the-disk-activity-on-os-x</a></p>
<p>There are two suggestions on that thread. Either using &#8216;<code>iotop -C 5 12' or using '</code><code>fs_usage'.</code></p>
<p>What I would like to find though is a tool that would analyze my Mac&#8217;s resources over a full day of work and that would report what should be tweaked. I don&#8217;t know if such a tool exists though. I you know of one, please let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.beauchamp.me/techno/mac/what-process-is-causing-disk-io/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My PPA Int’l eSata ExpressCard is finally working with Snow Leopard</title>
		<link>http://www.beauchamp.me/techno/mac/ppa-intl-esata-expresscard-working-with-snow-leopard/</link>
		<comments>http://www.beauchamp.me/techno/mac/ppa-intl-esata-expresscard-working-with-snow-leopard/#comments</comments>
		<pubDate>Sat, 02 Jan 2010 22:22:51 +0000</pubDate>
		<dc:creator>jf</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[eSata]]></category>
		<category><![CDATA[Macbook Pro]]></category>
		<category><![CDATA[Snow Leopard]]></category>

		<guid isPermaLink="false">http://www.beauchamp.me/techno/?p=133</guid>
		<description><![CDATA[After I had read a post about someone who managed to boot his Macbook Pro from an external drive using a PPA Int’l eSata ExpressCard, I ordered such a card too. However, it did not work fro me. My external drive would not mount. I never found out why, but after I upgraded to Snow [...]]]></description>
			<content:encoded><![CDATA[<p>After I had read a post about someone who managed to boot his Macbook Pro from an external drive using a <a title="PPA Int'l" href="http://www.ppa-usa.com/" target="_blank">PPA Int’l</a> eSata ExpressCard, I ordered such a card too. However, it did not work fro me. My external drive would not mount. I never found out why, but after I upgraded to Snow Leopard, I decided to give it a try again, and I found out that my eSata ExpressCard that had been siting in a drawer for ages was now working. I am using the same external drive that I had try about a year ago, and it has now been working perfectly for over a month now. I am even set up my TimeMachine to do backup on that drive, and it is working without a glitch. My MBP is an early 2008 one, just in case it makes a difference.</p>
<p>One thing I have to tell though is that <a title="PPA Int'l" href="http://www.ppa-usa.com/" target="_blank">PPA Int’l</a> support is very poor. I got only one reply from them telling me to try the <a title="drivers from the JMicron web site" href="http://www.jmicron.com/Driver.htm" target="_blank">drivers from the JMicron web site</a>, which did not work with OS X 10.5.x. After I have never been able to get anymore support from them. They would not reply to my e-mails.</p>
<p>I haven&#8217;t tried though to boot from an external drive using the eSata card.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.beauchamp.me/techno/mac/ppa-intl-esata-expresscard-working-with-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to synchronize users after a database restore</title>
		<link>http://www.beauchamp.me/techno/sql-server-2005/how-to-synchronize-users-after-a-database-restore/</link>
		<comments>http://www.beauchamp.me/techno/sql-server-2005/how-to-synchronize-users-after-a-database-restore/#comments</comments>
		<pubDate>Wed, 14 Oct 2009 17:00:33 +0000</pubDate>
		<dc:creator>jf</dc:creator>
				<category><![CDATA[SQL Server 2005]]></category>
		<category><![CDATA[SQL Server 2008]]></category>

		<guid isPermaLink="false">http://www.beauchamp.me/techno/?p=131</guid>
		<description><![CDATA[After restoring a database on a different server than the one it is coming from, it will contain orphaned users. Here is how to find these orphaned users: exec sp_change_users_login 'report' In order to fix this, the logins for the reported users will have to be created on the new server if they do not [...]]]></description>
			<content:encoded><![CDATA[<p>After restoring a database on a different server than the one it is coming from, it will contain orphaned users. Here is how to find these orphaned users:</p>
<blockquote>
<pre class="brush:sql">exec sp_change_users_login 'report'</pre>
</blockquote>
<p>In order to fix this, the logins for the reported users will have to be created on the new server if they do not exist.</p>
<p>If the logins are the same as on the original server, it is easy to fix the orphaned users. Simply issue the following command for each orphaned user:</p>
<blockquote>
<pre class="brush:sql">exec sp_change_users_login 'auto_fix', '&lt;replace this by the username...&gt;'</pre>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.beauchamp.me/techno/sql-server-2005/how-to-synchronize-users-after-a-database-restore/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

