Microsoft, Information Technologies...



  • From Taiwan, living and working at Tokyo, Japan.

Recent Posts


Microsoft Sites

Other Sites

Blog pools



Site Info

Locations of visitors to this page

Logos & Chicklets


Rex's Certifications
Rex's Certifications

Creative Commons授權條款
本 著作 係採用
Creative Commons 授權條款

October 2006 - Posts

LINQ / DLINQ resource...


Just read from ScottGu's blog post that included useful links to LINQ / DLINQ .

just leave a record here and will post more after I read them.

Technorati Tags: linq , dlinq , orm , programming


CommunityServer 2.1 Tips: Gallery photo options, save to DB or save to file...


Just had a trace to the source code since I found some of my gallery photos were missing and not able to get them back while upgrading my blog site to CS 2.1 in my VM.

Later found that in .Text era, images were saving to DB only; later in CS 1.x era, images were changed to save to files to minimize DB space usage. now in CS 2.1 , it can now be set to either places, or both.

in CS 1.x , the default image saving location is at ~/photos/storage , while it's the same as in CS 2.1 , if you find your images missing to display on browser, remember to copy all the files in ~/photos/storage of CS 1.x web spaces.

in CS 2.1, now there are options to let you set where to save, DB or file, or both. refer to default CommunityServer.config file , like the following:

              enableFileSystemStorage="true" fileSystemStorageLocation="~/photos/storage"
              enableDataStoreStorage="true"  enableDirectLinks="false"
              extensions = "gif,jpg,jpeg,png,bmp,GIF,JPEG,JPG,PNG,BMP,Gif,Jpg,Jpeg,Png,Bmp" />
              enableFileSystemStorage="true" fileSystemStorageLocation="~/photos/cache"
              enableDataStoreStorage="false"  enableDirectLinks="false"

AttachmentSettings is the place to toggle where to save images to. if set both enableFileSystemStorage and enableDataStoreStorage to true, not only image files will be create and save in ~/photos/storage folder, but also will be saved to database record binary field (cs_PostAttachment table). Refer to GalleryPosts.cs file of CommunityServerGalleries20 project (started from line 387):

  //TODO: work on new save attachement patterns
  private static void CreatePictureData(GalleryPost galleryPost, PostAttachment pictureData)

   // Submit it to the database
   if (GalleryConfiguration.Instance().AttachmentSettings.EnableDataStoreStorage && pictureData.HasDateCreated)
    CommonDataProvider.Instance().AddPostAttachment(galleryPost, pictureData);
    PostAttachment noPictureData = new PostAttachment(pictureData);
    noPictureData.Content = null;
    CommonDataProvider.Instance().AddPostAttachment(galleryPost, noPictureData);

   // If file system storage is enabled, we need to save it.
   if (GalleryConfiguration.Instance().AttachmentSettings.EnableFileSystemStorage)
    CreateDataFile(galleryPost, pictureData);


basically this checks both flags to see if they are true, and then save to each places (DB and file). but if DataStoreStorage flag is false, then while saving the data record, will set Content binary field to null.

By default setting in CS 2.1 , it seems set both DB and file flags to true. To preserve the same usage as in CS 1.x , it's needed to change the enableDataStoreStorage to false.

CacheSettings also using the same setting pattern as AttachmentSettings, but actually DataStore support for Cache is currently not supported in this version, as stated in the comment of CommunityServer.config file.

Technorati Tags: communityserver , , programming


Tips: Installing sdk version of CommunityServer 2.1...


So I finally got some time to start the process of upgrading this blog site to CommunityServer 2.1. I downloaded the 2.1 SDK source, also requested a backup of currently running CS1.1 database from my web-hosting-provider, and started from here.

I had created a virtual machine as my development environment, with Windows 2003 R2 server and VisualStudio Team Suite  installed. as this website is currently running under ASP.NET 1.1, I am trying to start running it under ASP.NET 2.0. The goal is to preserve all my blog posts, photo images, and comments and do the technology upgrade and version-up reconstruction.

After unpack the SDK, and trying to open 2.0 solution file from VisualStudio, the first problem will be that VS2005 won't be able to open the web project since VS2005 now has a new non-project model for website solution. to solve this, I need to download the new Web Application Project (WAP) from ScottGu's website and install it. while the WAP installation it will require another VS2005 updates prior it. After the installation of WAP, CS2.1's ASP.NET 2.0 web project can be opened without problems.

For the IIS part, first editing the hosts file (on windows folder) to point my domain name to localhost, then create a virtual website to point to SDK's web folder, refering to the documentation to set proper read/write priviledges to folders.

For the database part, follow SDK's sqlscript folder's readme file to upgrade database schema from CS 1.1 to CS 2.1.

I did a full rebuild from the source code to regenerate all necessary binaries, and then trying to open my test site in browser. error happaned.

ERROR: Could not load file or assembly 'MemberRole, Version=, Culture=neutral, PublicKeyToken=b7c773fb104e7562' or one of its dependencies

Doing a search from google, found that I need to switch to 2.0 version's web.config file to avoid this error. the files is under "ASP.NET2_configs" folder of SDK source. I did the replace and trying to run again, another error occured.

Login failed for user ''. The user is not associated with a trusted SQL Server connection

Doing a search from google, found that it is something related to trusted connection to SQL server. since I am running CS database in different SqlServer 2005 machine other then web application machine, I decided to avoid this problem by not using trusted connection but using usual SqlServer authentication. just edit the web.config file and change the sqlserver connection string to set Trusted_Connection from yes to no.

By setting all those above, I can get a running instance of CS 2.1 site under my dev VM. the next is to modify the themes and skins of my blogs, also need to modify the source code to support non-keyword searching to be able to search Chinese and Japanese. also need to check about the new url rewrite model to see if it fits my requests (out-site url rewrite).

still need some time to finish my CS2.1 blog site, will post other tips if I found any.

Technorati Tags: communityserver , , programming


RealVNC server is not working on Vista RC2 (build 5744)...


Just installed Windows Vista Ultimate RC2 (build 5744) on my office PC, and trying to install several software that I often used to see if they can run ok on this platform.

Windows RDP is working ok without problem, although it will always show up a dialog saying that it can not verify and identify the host that's connecting to.

trying to install RealVNC 4.1.1, the installation did success, the VNC server also started ok, I did open the port 5900 in Windows Firewall settings. but fail to connect using VNC viewer on other hosts, the connection just disconnect unexpectedly.

VNC should not working on Vista for now.

Technorati Tags: microsoft , windows , vistarealvncvnc


Internet Explorer 7.0 released...


Yesterday (10/19) Microsoft just released Internet Explorer 7.0 . right now only English version is available for download. Asian languages are not released yet for now.

download from here. It will check if the installing machine has valid Windows OS installed, also take some time to install and will require a reboot.

Technorati Tags: microsoft , browser , internet explorer


Patterns and Practices Guidance Explorer...



[via ScottGu]

Saw from Scott's blog about Patterns and Practices Guidance Explorer project, which lets you browse guidances from MS PAG, organize your own pattern groups, or even writing your own guidance and sharing with others.

It's also having online version to browse those guidances online.

This should be good for dev teams to organize, manage, and share group-wide guidances and accumulate knowledge assets.

download here . channel 9 wiki

Technorati Tags: microsoft , pattern , programmingarchitectureguidance

Visual Studio Team Edition for DB Pros CTP6 released...


[via ScottGu]

Visual Studio Team Edition for Database Professionals just released CTP6, which included fixes and feedbacks to make it a better one.

It's necessary to uninstall CTP5 before installing CTP6.

Scott also mentioned some good db tools to help generating test data (MassDataHandler) or creating database documents (Data Dictionary Creator).

This should be a good platform for programmingly manipulating data and database while doing database related solutions.

Technorati Tags: microsoft , visualstudio , programmingdatabase


Nice Java Regular Expression online test page...


Just found it while designing a java regex pattern, the online java regular expression tester.

it behaves the same like Regexlib site in .Net world, but the syntax is java based , which is convinient while writing Java regular expression patterns.

Technorati Tags: java , regular expression , programming