June 2009 Entries

  • ASP.NET MVC with unit testing

    Some useful links for later perusal: http://johnnycoder.com/blog/2009/04/01/aspnet-mvc-test-template-project-for-nunit-and-moq/ http://msdn.microsoft.com/en-us/library/dd381614.aspx http://weblogs.asp.net/scottgu/archive/2007/11/13/asp-net-mvc-framework-part-1.aspx

  • Writing SqlAnywhere 7 stored procedures in C#

    These have to be written using C++/CLI. The following example tries to find the Year in a relatively free-format date string. #include "stdafx.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include <stdarg.h> #using <system.dll> using namespace System; using namespace System::Text::RegularExpressions; #include <vcclr.h> // StringConvertor from CodeProject (http://www.codeproject.com/KB/string/StringConvertor.aspx) #include "StringConvertor.h" #include "C:/Program Files/Sybase/SQL Anywhere 7/h/extfnapi.h" #include "C:/Program Files/Sybase/SQL Anywhere 7/h/sqldef.h" // This function is needed by SQL Anywhere extern "C" _declspec(dllexport) UINT32 __stdcall extfn_use_new_api( ) { return EXTFN_API_VERSION; } extern "C" _declspec(dllexport) void __stdcall GetYear( an_extfn_api * api, void * hArg) { an_extfn_value sInValue; memset(&sInValue, 0, sizeof(an_extfn_value)); api->get_value(hArg, 1, &sInValue); System::DateTime ^ birthyear = gcnew System::DateTime(); StringUtilities::StringConvertor sc1((const...