Dynamics CRM に XRM を使ってアクセスしている際に、Generic SQL Error となる場合があります。

わかりにくいエラーのため原因がどこにあるのかわかりにくいのですが、CRM Database へのアクセスでタイムアウトが発生した際にもこのエラーとなります。
タイムアウトは回避する方法としては、CRM サーバーのレジストリで OLEDB のデフォルトタイムアウトを変更するという方法が利用できます。

レジストリエディタで
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSCRM\
に DWORD で OLEDBTimeout というキーにタイムアウトに設定する秒数を指定します。
デフォルトでは、30秒となっているようです。

レジストリを書き換えたら、IISの CRM が利用しているアプリケーションプールを再起動することで、設定が反映されます。

その他詳しい情報として、下記の Blog もありますので、併せて利用してみてください。
http://billoncrmtech.blogspot.com/2008/10/sql-timeouts-in-crm-generic-sql-error.html

Currently rated 3.0 by 28 people

  • Currently 3/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Dynamics CRM SDK に xRM が追加されて LINQ を使ったアクセスなどができるようになりました。
これを使うと非常に簡単に Dynamics CRM にアクセスできるようになったのですが、Update する際に StatusCode が変更できない問題にあたりました。

0x80048408 : 2 is not a valid status code for state code AccountState.Active on account.

まだ xRM のドキュメントが少なく、ステータスをアップデートする方法を探し、以下の方法で StatusCode / StateCode を更新できることがわかりました。

context.UsingService(service =>
   {
      var request = new Microsoft.Crm.SdkTypeProxy.SetStateAccountRequest()
      {
         AccountState = Microsoft.Crm.SdkTypeProxy.AccountState.Inactive,
         AccountStatus = 1 + (int)Microsoft.Crm.SdkTypeProxy.AccountState.Inactive,
         EntityId = entity.accountid
      };

      service.Execute(request);
    }
  );

もはや xRM の影がないのですが、べたべたな方法なもののこれでアップデート可能でした。

Currently rated 3.0 by 5 people

  • Currently 3/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

オライリーの Blog 読者向けに、PC上で操作できるデータ集録システムの LabView が
USB接続のデバイスとセットで20,790円という大キャンペーンになっています。
http://www.oreilly.co.jp/mtm/04/sp_labview.html

新規ユーザー向けに12月25日までの数量限定キャンペーンですが、
Windows PCからセンサーデータを収集したり、また逆に信号を出力して
ほかのデバイスを制御したりといったことが、LabViewというプログラミングツールを使って可能になります。

今回は製品版が特別提供されているということで、
これを機会に新しいアプリ開発のアイデアをいろいろ実現することもできそうです

Currently rated 3.0 by 5 people

  • Currently 3/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Exchange Web Services を経由して、アクセスに使っている Credendial とは違うユーザーのメールボックスにアクセスしたいときは、ImpersonatedUserId を使ってアクセスしたいメールボックスのアカウントを指定します。
この際に、アクセス先のメールボックスの権限設定を行うだけでは、ユーザー偽装ができず正しくアクセスできません。

これはユーザーの偽装を行うために必要な権限が Active Directory に設定されていない場合に発生します。
偽装してアクセスするためには、サーバーでのアクセス偽装の権限設定と、メールボックス自体での偽装の設定が必要です。

権限を設定するには、Exchange 管理シェルで次のコマンドを実行します。

// すべてのクライアントアクセスサーバーで、Administrator に偽装を許可する
Get-ExchangeServer | where {$_.IsClientAccessServer -eq $TRUE} | ForEach-Object {Add-ADPermission -Identity $_.distinguishedname -User (Get-User -Identity "Administrator" | select-object).identity -extendedRight ms-Exch-EPI-Impersonation}

// すべてのメールボックスデータベースで、Administrator に偽装を許可する
Get-MailboxDatabase | ForEach-Object {Add-ADPermission -Identity $_.DistinguishedName -User "Administrator" -ExtendedRights ms-Exch-EPI-May-Impersonate}

この権限を付与されれば EWS を呼び出す次のようなコードを使うことで、ほかのユーザーのメールボックスにアクセスできるようになります。

// 指定したアドレスを持つユーザーのメールボックスに接続するために偽装を行う
service.ImpersonatedUserId = new ImpersonatedUserId(ConnectingIdType.SmtpAddress, "User1@exchange.local");

Currently rated 2.2 by 27 people

  • Currently 2.222223/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Visual Studio User Group と IIS User Group が協力し、Windows Azure の特別ハンズオンセッションが開催されます。

今回は各自がノートPCを持参して、実際に Azure 上にアプリケーションを構築しながら体感するハンズオンセッションとのこと。参加費も無料とのことですのでこの機会に Windows Azure を自ら体験するいい機会ではないでしょうか 

【緊急開催】VSUGアカデミー 特別無償開催「クラウドにのっけてみよう - Windows Azure の実際」
http://iis.itadmin.jp/news-and-events/event-20090930.aspx

アジェンダ
講師: VSUGフォーラムリーダー 酒井 達明 氏 (株式会社日立システムアンドサービス 研究開発センタ)

現在CTP(Community Technnology Preview)の段階にあり、正式リリースが目前であるWindows Azureを、そろそろ実際に試してみようという企画です。

ある程度Visual Studioが利用できる開発者を対象として、実際の開発環境の構築から、Windows Azureのアカウント取得、簡単なプログラムの実際にAzure上への展開までを参加者ご自身のノートPCで実際に試してみようというセミナーです。

今回は、 Visual Studio User Group に IIS User Group が協力し、特別ハンズオンセッションを実施します。 

Currently rated 2.5 by 4 people

  • Currently 2.5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Windows Server 2008 R2 からは Server Core でも .NET Framework がサポートされ、Server Core の IIS7.5 で ASP.NET アプリケーションを実行できるなど、Server Core 活用の幅が広がっています。

しかしこの Server Core での .NET Framework サポートはサブセットのみであり、どのネームスペースがサポートされないかが重要になります。その情報が TechNet Blog に掲載されていましたので紹介します。

  • Microsoft.Aspnet.Snapin
  • Microsoft.Ink
  • Microsoft.ManagementConsole.*
  • Microsoft.StylusInput.*
  • Microsoft.VisualBasic.Compatibility.VB6
  • Microsoft.Windows.Themes
  • Microsoft.WindowsCE.Forms
  • Microsoft.WindowsMobile.DirectX.*
  • System.ComponentModel.Design.*
  • System.Data.Design
  • System.Deployment.Application
  • System.Diagnostics.Design
  • System.Media
  • System.Messaging.*
  • System.Speech.*
  • System.Web.UI.Design.*
    (design time support in this namespace is unavailable, runtime support for expression builders is supported)
  • System.Windows.*
  • UIAutomationClientsideProviders

また妥当なところといえば妥当なところでしょうか。

.NET 2.0 and Server Core in Windows Server 2008 R2
http://blogs.technet.com/server_core/archive/2008/11/25/net-2-0-and-server-core-in-windows-server-2008-r2.aspx

Currently rated 3.0 by 112 people

  • Currently 2.991071/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

MPI.net

2008-10-06

日本でも Windows HPC Server 2008 が発表されましたが
このクラスタノードで実行するアプリを書くためのライブラリとして
MPI.net (High-Performance C# Library for Message Passing) というライブラリが公開されていました

通常は C++ での開発となることが多いと思いますが
このライブラリを使うことで C# で Message Passing Interface を使って
Network Direct などのノード間通信を使いながらクラスタ計算が可能になる模様

詳しく試していませんがなかなかおもしろそうな予感です

MPI.net
http://www.osl.iu.edu/research/mpi.net/

Currently rated 3.0 by 5 people

  • Currently 3/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Admintech.jp のセミナー中に作ったコードをコマンドとして使えるように拡張しました

イベントログの内容を正規表現を使うことで
取り出したい内容をもったログだけを標準出力に吐きだせるようにしました

使い方としては、コマンド引数として /s:{イベントログのソース} "正規表現" を渡すと
指定したソース (Application や System) から正規表現にログの内容がマッチしたものを
まとめてCSVで出力するようになっています

また /n オプションを使うと、正規表現にマッチしなかったログだけを出力できます

using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using System.Diagnostics;

namespace EnvironmentManagement
{
    class Program
    {
        static int Main(string[] args)
        {
            Regex cmdHelp =
               new Regex("^/h", 
                 RegexOptions.Compiled | RegexOptions.CultureInvariant | RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase);
            Regex cmdPositive = 
               new Regex("^/p", 
                 RegexOptions.Compiled | RegexOptions.CultureInvariant | RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase);
            Regex cmdNegative = 
               new Regex("^/n", 
                 RegexOptions.Compiled | RegexOptions.CultureInvariant | RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase);
            Regex cmdQuit = 
               new Regex("^/q", 
                 RegexOptions.Compiled | RegexOptions.CultureInvariant | RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase);
            Regex cmdSource = 
               new Regex("^/s:\"?(?<source>.*)\"?", 
                 RegexOptions.Compiled | RegexOptions.CultureInvariant | RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase);

            bool quitMode = false;
            bool positiveMatch = true;
            string expression = String.Empty;
            string source = String.Empty;

            foreach (string param in args)
            {
                if (cmdHelp.IsMatch(param))
                {
                    ShowHelp();

                    return 0;
                }

                if (cmdPositive.IsMatch(param))
                {
                    positiveMatch = true;
                }
                else if (cmdNegative.IsMatch(param))
                {
                    positiveMatch = false;
                }
                else if (cmdQuit.IsMatch(param))
                {
                    quitMode = true;
                }
                else if (cmdSource.IsMatch(param))
                {
                    Match match = cmdSource.Match(param);

                    source = match.Groups["source"].Value;
                }
                else
                {
                    expression = param;
                }
            }

            if (!quitMode)
            {
                Console.WriteLine("EventLog Exporter with Regular Expressions");
                Console.WriteLine();
            }

            if (expression == string.Empty)
            {
                if (!quitMode) Console.Error.WriteLine("Please input regular expressions.");

                return 1;
            }
            else if (source == string.Empty)
            {
                if (!quitMode) Console.Error.WriteLine("Please input eventlog source name.");

                return 1;
            }

            try
            {
                ReadEventLogs(source, expression, positiveMatch);
            }
            catch (Exception e)
            {
                if (!quitMode)
                {
                    Console.Error.Write(e.Source);
                    Console.Error.Write(", ");
                    Console.Error.WriteLine(e.Message);
                }

                return 1;
            }

            return 0;
        }

        private static void ReadEventLogs(string source, string expression, bool positiveMatch)
        {
            EventLog logs = new EventLog(source);
            Regex regex = new Regex(expression, 
                 RegexOptions.Compiled | RegexOptions.CultureInvariant | RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase);

            OutputHeader();

            foreach (EventLogEntry entry in logs.Entries)
            {
                if (positiveMatch && regex.IsMatch(entry.Message))
                {
                    OutputLog(entry, source);
                }
                else if (!positiveMatch && !regex.IsMatch(entry.Message))
                {
                    OutputLog(entry, source);
                }
            }
        }

        private static void OutputHeader()
        {
            Console.Write("\"");
            Console.Write("Source");
            Console.Write("\",");

            Console.Write("\"");
            Console.Write("InstanceId");
            Console.Write("\",");

            Console.Write("\"");
            Console.Write("EntryType");
            Console.Write("\",");

            Console.Write("\"");
            Console.Write("Category");
            Console.Write("\",");

            Console.Write("\"");
            Console.Write("ApplicationSource");
            Console.Write("\",");

            Console.Write("\"");
            Console.Write("TimeGenerated");
            Console.Write("\",");

            Console.Write("\"");
            Console.Write("TimeWritten");
            Console.Write("\",");

            Console.Write("\"");
            Console.Write("MachineName");
            Console.Write("\",");

            Console.Write("\"");
            Console.Write("Username");
            Console.Write("\",");

            Console.Write("\"");
            Console.Write("Message");
            Console.Write("\"");

            Console.WriteLine();
        }

        private static void OutputLog(EventLogEntry entry, string source)
        {
            Console.Write("\"");
            Console.Write(source);
            Console.Write("\",");

            Console.Write("\"");
            Console.Write(entry.InstanceId.ToString());
            Console.Write("\",");

            Console.Write("\"");
            Console.Write(entry.EntryType.ToString());
            Console.Write("\",");

            Console.Write("\"");
            Console.Write(entry.Category);
            Console.Write("\",");

            Console.Write("\"");
            Console.Write(entry.Source);
            Console.Write("\",");

            Console.Write("\"");
            Console.Write(entry.TimeGenerated.ToString("s"));
            Console.Write("\",");

            Console.Write("\"");
            Console.Write(entry.TimeWritten.ToString("s"));
            Console.Write("\",");

            Console.Write("\"");
            Console.Write(entry.MachineName);
            Console.Write("\",");

            Console.Write("\"");
            Console.Write(entry.UserName);
            Console.Write("\",");

            Console.Write("\"");
            Console.Write(entry.Message.Replace("\"", "'"));
            Console.Write("\"");

            Console.WriteLine();
        }

        private static void ShowHelp()
        {
            Console.WriteLine("EventLog with regular expressions:");

            Console.WriteLine();

            Console.WriteLine(String.Format("{0} {1}", 
               System.IO.Path.GetFileNameWithoutExtension(Environment.GetCommandLineArgs()[0]), 
               "/h /p /n /q /s:{EventLogSource} \"{RegularExpression}\""));

            Console.WriteLine();
            Console.WriteLine();
            Console.WriteLine();

            Console.WriteLine("\t/h\tShow help.");
            Console.WriteLine("\t/p\tIf regular expressoin is match, to EventLog export.");
            Console.WriteLine("\t/p\tIf regular expression is not match, to EventLog export.");
            Console.WriteLine("\t/q\tQuit mode.");
            Console.WriteLine("\t/s:{EventLogSource}\n\t\tExporting EventLog source name.");
            Console.WriteLine("\t\"{RegularExpression}\"\n\t\tSearch keyword");

            Console.WriteLine();
        }
    }
}

Currently rated 3.0 by 5 people

  • Currently 3/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Do Less. Get More. Develop on SharePoint ということで
MOSS に関連するリソースがまとまっているサイトが公開されていました

さりげなく Silverlight が使われていたりとなかなかセンスのいい感じにまとまってます

http://www.microsoft.com/click/SharePointDeveloper/default.aspx

Currently rated 3.0 by 191 people

  • Currently 3.001048/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Microsoft から Database, Filesystem, RSS に対応したデータ同期用フレームワークのCTPがでていました

どうやらこのフレームワークを使うと、バージョンや更新時間などのメタデータを元に、
データソースの同期を簡単に実装できるようになっている模様です

http://www.microsoft.com/downloads/details.aspx?FamilyID=35E8F16E-AAA4-4919-8B3C-1CE4EA1F6552&displaylang=en

Currently rated 3.0 by 5 people

  • Currently 3/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

MSN Search SDK Beta

2006-01-15

MSN Search Web Service SDK Beta v0.60 が公開されていました

やや詳細不明ではありますが
どうやら MSN Search の結果を Web Service で取り込み
それを使うための SDK みたいですね

ドキュメントやサンプルコードも含まれている模様です

http://www.microsoft.com/downloads/details.aspx?familyid=C271309B-02DE-42A7-B23E-E19F68667197&displaylang=en

Currently rated 3.0 by 5 people

  • Currently 3/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

"Visual Basic .NET 2003 および Visual Basic .NET 2002 で Dsofile.dll を使用すると Office がなくても Office ドキュメントのプロパティを編集できる"
と題したKBが公開されていました

このKBでは C++ で作られたサンプルActiveX コンポーネントが紹介されていて
DLLを経由してOLE構造化ストレージのプロパティにアクセスする方法が書かれています

コンポーネントは再配布可能とのことですので
あのメタデータを操作したかった方には朗報ではないでしょうか

http://support.microsoft.com/default.aspx?scid=kb;ja;224351

Currently rated 2.8 by 154 people

  • Currently 2.75974/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Acrylic October 2005 CTP に XAML Exporter がでました

Avalon のインターフェイスデザイナになりそうな Acrylic ですが
ついに XAML Exporter がでたことでいろいろ試せそうですね

http://www.microsoft.com/downloads/details.aspx?FamilyID=286D50B8-4D6F-460A-A83B-D4D0ED2EBF39&displaylang=en

Currently rated 3.3 by 70 people

  • Currently 3.287054/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

C# が日本工業規格 (JIS) に JIS X 3015 として制定されました
http://www.microsoft.com/japan/presspass/detail.aspx?newsid=2236
http://www.exconn.net/Blogs/team01/archive/2005/03/22/292.aspx

すでに ECMA や ISO/ETC でも標準化されてますが
これによってさらに普及していくんでしょうかね~

また C#?の MVP たちのコメントも掲載されています

http://www.exconn.net/Blogs/team00/archive/2005/03/22/293.aspx
http://www.microsoft.com/japan/msdn/vcsharp/BeSharpCsharp/daisuki.aspx

Currently rated 2.7 by 298 people

  • Currently 2.69463/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

WiX

2005-03-17

Visual Studio.NET では定型のインストーラしか作成できませんが
こちらは XML でインストーラを定義することによって
かなり自由にインストーラを生成することが可能なようです

かわりに Windows Installer を相当知っていないとダメとのことですけど...
でも MSP まで作れるというのが魅力的ですな

http://sourceforge.net/projects/wix/
http://www.ailight.jp/blog/sha256/archive/2005/03/14/4950.aspx

Currently rated 2.6 by 302 people

  • Currently 2.617193/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5