<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
   <title>sanryuブログ</title>
   <link rel="alternate" type="text/html" href="http://www.sanryu.net/mt/" />
   <link rel="self" type="application/atom+xml" href="http://www.sanryu.net/mt/atom.xml" />
   <id>tag:www.sanryu.net,2011:/mt//1</id>
   <updated>2011-11-14T03:13:46Z</updated>
   
   <generator uri="http://www.sixapart.com/movabletype/">Movable Type 3.35</generator>

<entry>
   <title>[VB.NET]WMIでプリンタジョブを取得する</title>
   <link rel="alternate" type="text/html" href="http://www.sanryu.net/mt/2011/11/vbnetwmi.html" />
   <id>tag:www.sanryu.net,2011:/mt//1.211</id>
   
   <published>2011-11-14T03:08:44Z</published>
   <updated>2011-11-14T03:13:46Z</updated>
   
   <summary>     &apos;&apos;&apos;      &apos;&apos;&apos; プリンタジョブを取得する     &apos;&apos;&apos;  ...</summary>
   <author>
      <name></name>
      
   </author>
         <category term="VB.NET" scheme="http://www.sixapart.com/ns/types#category" />
   
   
   <content type="html" xml:lang="ja" xml:base="http://www.sanryu.net/mt/">
      <![CDATA[<pre class="brush:vb">
    ''' <summary>
    ''' プリンタジョブを取得する
    ''' </summary>
    ''' <param name="printerName">プリンタ名</param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Shared Function GetPrintJobsCollection(ByVal printerName As String) As List(Of String)
　
        Dim printJobCollection As New List(Of String)
        Dim searchQuery As String = "SELECT * FROM Win32_PrintJob"
        Dim searchPrintJobs As ManagementObjectSearcher = New ManagementObjectSearcher(searchQuery)
　
        Dim prntJobCollection As ManagementObjectCollection = searchPrintJobs.Get()
　
        For Each prntJob As ManagementObject In prntJobCollection
            Dim jobName As String = prntJob.Properties("Name").Value.ToString()
　
            Dim prnterName As String = jobName.Split(",")(0)
            Dim documentName As String = prntJob.Properties("Document").Value.ToString()
      　    If String.Compare(prnterName, printerName) = 0 Then
                printJobCollection.Add(documentName)
            End If
        Next
        Return printJobCollection
    End Function

</pre>]]>
      
   </content>
</entry>
<entry>
   <title>[SPREAD][テキストセル]複数行表示と改行コードの動作</title>
   <link rel="alternate" type="text/html" href="http://www.sanryu.net/mt/2011/10/spread_3.html" />
   <id>tag:www.sanryu.net,2011:/mt//1.210</id>
   
   <published>2011-10-13T02:08:20Z</published>
   <updated>2011-10-13T02:26:04Z</updated>
   
   <summary>環境：VB.NET 2005、SPREAD for Windows Forms ...</summary>
   <author>
      <name></name>
      
   </author>
         <category term="SPREAD for Windows Forms 5.0J" scheme="http://www.sixapart.com/ns/types#category" />
   
   
   <content type="html" xml:lang="ja" xml:base="http://www.sanryu.net/mt/">
      <![CDATA[環境：VB.NET 2005、SPREAD for Windows Forms 5.0J

[確認]
MultilineをTrueに設定したテキストセルに、CRLF、CR、LFを含んだ値を設定する。

<pre class="brush:vb">
Dim txtMultiLineCellType As New FarPoint.Win.Spread.CellType.TextCellType
txtMultiLineCellType.Multiline = True
</pre>

<table>
<tr>
<td>設定する値</td>
<td>表示結果</td>
</tr>
<tr>
<td>"あ"+CR+LF+"い"</td>
<td>改行される</td>
</tr>
<tr>
<td>"あ"+CR+"い"</td>
<td> 改行されない</td>
</tr>
<tr>
<td>"あ"+LF+"い"</td>
<td> 改行される</td>
</tr>
</table>

[結果]
CRLF、LFは改行されて表示される。
]]>
      
   </content>
</entry>
<entry>
   <title>[VB.NET]WEBメソッドの改行コードが変換される</title>
   <link rel="alternate" type="text/html" href="http://www.sanryu.net/mt/2011/10/vbnetweb.html" />
   <id>tag:www.sanryu.net,2011:/mt//1.209</id>
   
   <published>2011-10-13T01:51:44Z</published>
   <updated>2011-10-13T02:07:13Z</updated>
   
   <summary>環境：VB.NET 2005 、スマートクライアント 改行コードCRがLFに変換...</summary>
   <author>
      <name></name>
      
   </author>
         <category term="VB.NET" scheme="http://www.sixapart.com/ns/types#category" />
   
   
   <content type="html" xml:lang="ja" xml:base="http://www.sanryu.net/mt/">
      <![CDATA[環境：VB.NET 2005 、スマートクライアント

<現象>
改行コードCRがLFに変換されている。

<参考サイト>

<a href="http://social.msdn.microsoft.com/Forums/ja-JP/netfxgeneralja/thread/247cbb61-be68-48c9-a436-53f373de17f8">Webメソッドのstring型の戻り値に含まれる改行コードが変換されてしまう</a>

<a href="http://tomcatch.blog38.fc2.com/blog-entry-12.html">WebMethod中の改行コード（CRLFがLFになっちゃう）</a>

<戻り値の型>
今回、確認できたは、戻り値の型は下記
（１）戻り値がDataTableの場合は、改行コードが変換される。
（２）戻り値がDataSetの場合は、改行コードが変換されない。

]]>
      
   </content>
</entry>
<entry>
   <title>テーブルの制約について</title>
   <link rel="alternate" type="text/html" href="http://www.sanryu.net/mt/2011/10/post_32.html" />
   <id>tag:www.sanryu.net,2011:/mt//1.208</id>
   
   <published>2011-10-07T04:07:44Z</published>
   <updated>2011-10-07T05:02:31Z</updated>
   
   <summary>テーブルに制約を指定していない為に、想定(意図)していない値が設定されて、 アプ...</summary>
   <author>
      <name></name>
      
   </author>
         <category term="データベースの設計について（私見）" scheme="http://www.sixapart.com/ns/types#category" />
   
   
   <content type="html" xml:lang="ja" xml:base="http://www.sanryu.net/mt/">
      テーブルに制約を指定していない為に、想定(意図)していない値が設定されて、
アプリケーションが正しく動作しないことがあります。
個人的には、（１）～(３)は、必ず指定して欲しいです。
（４）（５）は、設計はして欲しい。

（１）主キー制約（PRIMARY KEY制約）
　主キーのないテーブルは、原則だめ。※一時テーブルのみ可。

（２）一意キー制約（UNIQUE制約）
　代替キーを使用し、かつ、一意となる自然キーがある場合は指定する。

（３）NOT NULL制約
　NULLがだめな項目には必ず指定すること。

（４）CHECK制約
　意図している値があるなら指定すること。個人的にはあまり使用しない。
　アプリケーション側でチェックしている。

（５）参照整合性制約（REFERENCES制約）
　いろいろご意見あると思いますが、個人的には、設計時（ＥＲ図など）には指定しているが、
　実際のテーブル(物理構造)には適用していない。
　※レスポンス、メンテナンス、仕様変更などを考えると・・・・。


      
   </content>
</entry>
<entry>
   <title>[PowerShell]%(パーセント)はForEach-Objectの別名</title>
   <link rel="alternate" type="text/html" href="http://www.sanryu.net/mt/2011/10/powershellforeachobject.html" />
   <id>tag:www.sanryu.net,2011:/mt//1.207</id>
   
   <published>2011-10-06T23:50:23Z</published>
   <updated>2011-10-07T00:02:45Z</updated>
   
   <summary>別名定義を確認するためには, Get-Alias を使用する。...</summary>
   <author>
      <name></name>
      
   </author>
         <category term="PowerShell" scheme="http://www.sixapart.com/ns/types#category" />
   
   
   <content type="html" xml:lang="ja" xml:base="http://www.sanryu.net/mt/">
      <![CDATA[別名定義を確認するためには,

<pre class="brush: sql;">
Get-Alias
</pre>

を使用する。]]>
      
   </content>
</entry>
<entry>
   <title>開発でやってほしくないこと</title>
   <link rel="alternate" type="text/html" href="http://www.sanryu.net/mt/2011/09/post_31.html" />
   <id>tag:www.sanryu.net,2011:/mt//1.206</id>
   
   <published>2011-09-10T07:00:35Z</published>
   <updated>2011-09-10T07:57:02Z</updated>
   
   <summary>自分の周りの話です。世間ではどうなのでしょうか？ データ件数を考慮していないで設...</summary>
   <author>
      <name></name>
      
   </author>
         <category term="データベースの設計について（私見）" scheme="http://www.sixapart.com/ns/types#category" />
   
   
   <content type="html" xml:lang="ja" xml:base="http://www.sanryu.net/mt/">
      自分の周りの話です。世間ではどうなのでしょうか？

データ件数を考慮していないで設計・開発する為、
まともに動かないものが多いです。

（１）実行計画を取得しない。
ＳＱＬが自分の思ったとおりに実行されているか確認しない。

（２）実際のデータ件数を想定しない。
データ件数を考慮しない、データ件数がどのくらいか知らないでＳＱＬを作る。
※ＳＥがテーブル設計時にデータ件数を考慮しない。

（３）セオリー(チューニング含む)をやらない。
ＷＥＢでも、書籍でも、雑誌でもやらないでねと書いてあることを平気でやる。
かつ、やろうねと書いてあることをしない。

（４）システム標準ルールを無視する。
・・・・。

（５）実行時間の計測をしない。
・・・・。当然性能要件を守れない。

      
   </content>
</entry>
<entry>
   <title>[S2Dao]ODP.NETの接続PoolingはディフォルトでTRUE</title>
   <link rel="alternate" type="text/html" href="http://www.sanryu.net/mt/2011/09/s2daoodpnetpoolingtrue.html" />
   <id>tag:www.sanryu.net,2011:/mt//1.205</id>
   
   <published>2011-09-10T06:27:29Z</published>
   <updated>2011-09-10T06:49:02Z</updated>
   
   <summary>環境：S2Dao.net + ODP.net(ORACLE) DBに接続できない...</summary>
   <author>
      <name></name>
      
   </author>
         <category term="S2Dao.net" scheme="http://www.sixapart.com/ns/types#category" />
   
   
   <content type="html" xml:lang="ja" xml:base="http://www.sanryu.net/mt/">
      <![CDATA[環境：S2Dao.net + ODP.net(ORACLE)

<現象>
DBに接続できないとエラーがでた。

<原因>
(1)ODP.NETのPoolingがディフォルトでTRUEとなっている。
(2)ＤＢ接続時にプロファイルでリソース制限(IDLE_TIME)されていた。
上記(1)(2)の為、しばらくＤＢに接続しないでいると、プーリングされている接続が切断されてしまい
ＤＢに接続できなくなってしまった。

<対応>
(1)ODP.NETのPoolingをFALSEに設定。

※前提でリソース制限の解除はできない。
]]>
      
   </content>
</entry>
<entry>
   <title>トリガーの使用について</title>
   <link rel="alternate" type="text/html" href="http://www.sanryu.net/mt/2011/08/post_30.html" />
   <id>tag:www.sanryu.net,2011:/mt//1.204</id>
   
   <published>2011-08-27T06:28:52Z</published>
   <updated>2011-08-27T07:08:02Z</updated>
   
   <summary>トリガは使いたいが、こんな事があった。 　・仕様変更をしたとき、トリガだけ修正漏...</summary>
   <author>
      <name></name>
      
   </author>
         <category term="データベースの設計について（私見）" scheme="http://www.sixapart.com/ns/types#category" />
   
   
   <content type="html" xml:lang="ja" xml:base="http://www.sanryu.net/mt/">
      トリガは使いたいが、こんな事があった。

　・仕様変更をしたとき、トリガだけ修正漏れ。
　（仕様書のどこにもトリガを使用していること書いてない。）
　・トリガに限って仕様書ない。
　（別にトリガの問題ではない。）
　・運用を実施する人がトリガを知らない。
　・当該テーブルのデータをメンテナンスする時に、トリガが動くのを忘れてしまう。

なので、下記程度にとどめたい。
　・監査ログや、テーブルの履歴の作成みたいなの。

結論は、システム開発から運用まで考えて、
保守できる程度に使用すればいいかと思う。

      
   </content>
</entry>
<entry>
   <title>テーブルに必要なカラムについて</title>
   <link rel="alternate" type="text/html" href="http://www.sanryu.net/mt/2011/08/post_29.html" />
   <id>tag:www.sanryu.net,2011:/mt//1.203</id>
   
   <published>2011-08-27T05:59:12Z</published>
   <updated>2011-08-27T06:10:45Z</updated>
   
   <summary>（１）どのテーブルにも必要なカラム 　　「作成日」、「作成者」、「更新日」、「更...</summary>
   <author>
      <name></name>
      
   </author>
         <category term="データベースの設計について（私見）" scheme="http://www.sixapart.com/ns/types#category" />
   
   
   <content type="html" xml:lang="ja" xml:base="http://www.sanryu.net/mt/">
      （１）どのテーブルにも必要なカラム
　　「作成日」、「作成者」、「更新日」、「更新者」
（２）論理削除の場合に必要なカラム
　　「削除フラグ」、「削除日」、「削除者」
（３）世代（履歴）管理に必要なカラム
　　「使用（有効）開始日」「使用（有効）終了日」

      
   </content>
</entry>
<entry>
   <title>テーブル設計で考慮すること</title>
   <link rel="alternate" type="text/html" href="http://www.sanryu.net/mt/2011/08/post_28.html" />
   <id>tag:www.sanryu.net,2011:/mt//1.202</id>
   
   <published>2011-08-27T05:12:20Z</published>
   <updated>2011-08-27T06:24:42Z</updated>
   
   <summary>（１）サロゲートキーの使用。 　・自然キーには、ユニーク制約をつける。 （２）正...</summary>
   <author>
      <name></name>
      
   </author>
         <category term="データベースの設計について（私見）" scheme="http://www.sixapart.com/ns/types#category" />
   
   
   <content type="html" xml:lang="ja" xml:base="http://www.sanryu.net/mt/">
      （１）サロゲートキーの使用。
　・自然キーには、ユニーク制約をつける。
（２）正規化くずし。
（３）トランザクションへの値の埋め込み。
　・マスタデータが変更される場合、計算結果を格納する場合など考慮。
（４）削除の方針。
　・論理削除か物理削除するか。
（５）マテリアライズドビュー（Oracle）の使用。
（６）固有の値の作成にシーケンスの使用。

      
   </content>
</entry>
<entry>
   <title>カラム命名のルールについて</title>
   <link rel="alternate" type="text/html" href="http://www.sanryu.net/mt/2011/08/post_27.html" />
   <id>tag:www.sanryu.net,2011:/mt//1.201</id>
   
   <published>2011-08-27T04:54:17Z</published>
   <updated>2011-08-27T05:12:11Z</updated>
   
   <summary>（１）同一の内容を示すカラム名は同一とする。 　　・当たり前と思うかもしれません...</summary>
   <author>
      <name></name>
      
   </author>
         <category term="データベースの設計について（私見）" scheme="http://www.sixapart.com/ns/types#category" />
   
   
   <content type="html" xml:lang="ja" xml:base="http://www.sanryu.net/mt/">
      （１）同一の内容を示すカラム名は同一とする。
　　・当たり前と思うかもしれませんが、規模が大きいシステムだと複数人でテーブル設計をしていると、同じ物を指しているのに、違うカラム名だったりします。はっきり言って頭痛いです。
　　これを回避するには、システム開発用の辞書を作ったり、データベースモデリングツールを使ったりして対応します。
（２）○○フラグというカラム名の値は、0(false)または1(true)とする。NULLもNG。
　　・フラグと名前でいろんな値が入っていると訳が分からない。
（３）上記とかぶるが、○○フラグ、○○区分、○○分類、○○状態などのカラム名をよく見るが、適切な名前をつけること。
      
   </content>
</entry>
<entry>
   <title>オブジェクトの命名について</title>
   <link rel="alternate" type="text/html" href="http://www.sanryu.net/mt/2011/08/post_26.html" />
   <id>tag:www.sanryu.net,2011:/mt//1.200</id>
   
   <published>2011-08-27T04:39:50Z</published>
   <updated>2011-08-27T04:49:53Z</updated>
   
   <summary>（１）マルチバイトの使用は禁止。 　※理由はググッてください。 （２）開発前に命...</summary>
   <author>
      <name></name>
      
   </author>
         <category term="データベースの設計について（私見）" scheme="http://www.sixapart.com/ns/types#category" />
   
   
   <content type="html" xml:lang="ja" xml:base="http://www.sanryu.net/mt/">
      （１）マルチバイトの使用は禁止。
　※理由はググッてください。
（２）開発前に命名基準書を作成する。
（３）全て英語またはローマ字で表記する。
　※できる限り英語。
（４）ローマ字で表記する場合、ヘボン式で表記する。

      
   </content>
</entry>
<entry>
   <title>罹災証明でた</title>
   <link rel="alternate" type="text/html" href="http://www.sanryu.net/mt/2011/08/post_25.html" />
   <id>tag:www.sanryu.net,2011:/mt//1.199</id>
   
   <published>2011-08-14T11:55:25Z</published>
   <updated>2011-08-14T12:06:11Z</updated>
   
   <summary>家一部損壊でした。発行に約４カ月かかりました。 一部損壊で受けられる控除、補助は...</summary>
   <author>
      <name></name>
      
   </author>
         <category term="東北地方太平洋沖地震" scheme="http://www.sixapart.com/ns/types#category" />
   
   
   <content type="html" xml:lang="ja" xml:base="http://www.sanryu.net/mt/">
      家一部損壊でした。発行に約４カ月かかりました。
一部損壊で受けられる控除、補助は何もないです。

市役所自体が被災し、今だプレハブ営業中のため
仕方ないかと思います。

ただ、固定資産だけは減額していただきたく。
明らかに、もう価値ない。
      
   </content>
</entry>
<entry>
   <title>タランドゥスツヤクワガタ</title>
   <link rel="alternate" type="text/html" href="http://www.sanryu.net/mt/2011/08/post_24.html" />
   <id>tag:www.sanryu.net,2011:/mt//1.198</id>
   
   <published>2011-08-14T11:53:02Z</published>
   <updated>2011-08-14T11:54:50Z</updated>
   
   <summary>子供がくじをした。 タランドゥスツヤクワガタが当たった。 名前が『ロドリゲス』に...</summary>
   <author>
      <name></name>
      
   </author>
         <category term="sanryu" scheme="http://www.sixapart.com/ns/types#category" />
   
   
   <content type="html" xml:lang="ja" xml:base="http://www.sanryu.net/mt/">
      子供がくじをした。

タランドゥスツヤクワガタが当たった。

名前が『ロドリゲス』になった。

なんでですか？

      
   </content>
</entry>
<entry>
   <title>[VB.NET]既存の接続はリモート ホストに強制的に切断されました</title>
   <link rel="alternate" type="text/html" href="http://www.sanryu.net/mt/2011/07/vbnet.html" />
   <id>tag:www.sanryu.net,2011:/mt//1.197</id>
   
   <published>2011-07-12T01:14:42Z</published>
   <updated>2011-07-12T01:31:14Z</updated>
   
   <summary>[現象] VS2005、IIS7.0 スマートクライアント構成で、 Webサービ...</summary>
   <author>
      <name></name>
      
   </author>
         <category term="VB.NET" scheme="http://www.sixapart.com/ns/types#category" />
   
   
   <content type="html" xml:lang="ja" xml:base="http://www.sanryu.net/mt/">
      [現象]
VS2005、IIS7.0 スマートクライアント構成で、
Webサービス接続時に
「既存の接続はリモート ホストに強制的に切断されました」が発生。

[原因]
IIS7.0がHTTP1.1 で接続時にKeep-Aliveがディフォルトで有効になっていた為に発生。

[対応]
Keep-Aliveを有効にする必要性がない為に、無効とした。

      
   </content>
</entry>

</feed>

