One of the tapes in our tapeset failed, and a new one was labelled. This is where the trouble started.
Sony TSL300C Illegal Cassette Config
0 comments Filed Under: Illegal Cassette Config, Sony TSL 300C
Creating a SQL Server CLR Procedure
I ventured into unchartered territory (for myself) and created a SQL Server CLR Procedure today. It is actually very easy.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using Microsoft.SqlServer.Server;
namespace SQLCLRTest
{
public class SQLCLRDemo
{
[Microsoft.SqlServer.Server.SqlProcedure]
public static void HelloWorld()
{
using (SqlConnection conn =
new SqlConnection("context connection = true"))
{
conn.Open();
SqlCommand cmd = new SqlCommand();
cmd.Connection = conn;
cmd.CommandText = "SELECT 'Hello World!' AS Greeting";
SqlContext.Pipe.ExecuteAndSend(cmd);
}
}
}
}
CREATE ASSEMBLY SQLCLRTest FROM 'C:\work\sandbox\SQLCLRTest\SQLCLRTest\bin\Debug\SQLCLRTest.dll'
CREATE PROCEDURE HelloWorld
AS EXTERNAL NAME SQLCLRTest.[SQLCLRTest.SQLCLRDemo].HelloWorld
EXEC sp_configure 'clr enabled', 1;
RECONFIGURE WITH OVERRIDE;
GO
exec HelloWorld
Greeting
------------
Hello World!
(1 row(s) affected)
0 comments Filed Under: CLR Procedure, SQL Server
How to connect to SQL Server, VS TFS, etc using Windows Authentication when computer is not on Active Directory Domain
I often move around between different clients, and never join their domains, simply because my machine would get cluttered with policies and logon scripts, so I've encountered this problem before.
net use \\machinename\ipc$ /user:domain\userThis does not work for connecting to SQL Server with Windows Authentication though. I found this neat little trick to accomplish this:
runas.exe /netonly /user:This runs Management Studio as the domain user, which can then authenticate to SQL Server using Windows Authentication."C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\ide\SqlWb.exe"
0 comments Filed Under: Active Directory, ASP .Net Windows Authentication, SQL Server
ASP .Net Windows Authentication
If you use Windows Authentication, and the user is not allowed to access the specific page, a nasty 401.2 Access Denied error message will be displayed to the user. What if you want to display a friendly error message?
protected void Application_EndRequest(object sender, EventArgs e)
{
HttpContext context = HttpContext.Current;
if (context.Response.Status.Substring(0,3).Equals("401"))
{
context.Response.ClearContent();
context.Response.Write("<script language="javascript">" +
"self.location='NotAllowed.aspx';</script>");
}
}
Then you create the NotAllowed.aspx page to display a nice friendly message to the user.
0 comments Filed Under: ASP .Net Security, ASP .Net Windows Authentication
ASP.Net configure page-level security
Did you know that you can configure security on a page level instead of on a folder level, like the custom tool in Visual Studio does?
0 comments Filed Under: ASP .Net Security
Building a Linux MediaCentre
I'm currently toying with the idea of building a Linux MediaCentre to record and watch TV, as well as store and display photos, as my VCR is getting old.
0 comments Filed Under: Linux, Media Centre
Perl upgrade on FreeBSD
Have you ever done a perl upgrade on FreeBSD, only to find that none of your installed ports that use perl work anymore? I recently had that shock, and found the following hint:
1 comments Filed Under: FreeBSD, Perl
Flushmaster not flushing
We have two Cobra Flushmaster flushvalves in our toilets at home, and recently the one refused to flush. I enquired as to pricing, and was shocked. A new one is about R2k. I spoke to the guys in the plumbing department at my local hardware store, and they suggested a seal kit at R200. I was quite scared of tackling this, as I could end up having to fork out R2k if I get it wrong...
0 comments Filed Under: Flushmaster, Plumbing
SQL Server 2008 Spatial, Google MAPS API
At a recent TechDays event I was introduced to the spatial features in the latest version of SQL Server, 2008. Spatial apps has interested me for a while, but I never really got a chance to do anything, I suppose in a way due to the preceived complexity.
0 comments Filed Under: Google Maps, Spatial, SQL Server
Javascript, Timezones and Google Mail
Google hosts the email for my domain, and I've always had an issue with the times of messages in the message list displaying incorrectly. I just ignored it for a while, but then it became too irritating to ignore anymore.
0 comments Filed Under: FireFox, Google Chrome, Google Mail, Timezone, TZ, Windows XP
What is this all about?
When I was a little boy, I had a red knitted jacket that I used to live in, especially in winter. I was so fond of it, the workers on the farm called me Jasman, the Afrikaans for "Jacket Man", directly translated.
0 comments Filed Under: