//今日をセット DateTime DayThis = System.DateTime.Today; //経過日数 int Days1 = (int)(new DateTime(DayThis.Year, DayThis…
C# if複数条件
条件を複数個設けたい場合には、次のような論理演算子を使います。 if(a>1 && a<10) { // 処理(1) } aが1よりも大きく、かつ、aが10よりも小さい場合は、処理(1)で記述…
C# 日付型宣言とデータセット
//文字列をセット string da3 = “2012/11/30”; //日付型を宣言し、文字列を代入する DateTime da3 = DataTime.ParseExact(da3, &#…
C# 数値の有効範囲
データ型 数値の有効範囲 int型(System.Int32型) 符号付き32bit整数値。-2147483648 ~ 2147483647 uint型(System.UInt32型) 符号なし32bit整数値。0 ~ …
C# 日付 月初めと月末取得
this.dateTP1.value = “2012/4/3”; //月初め設定 this.dateTP1.Text = this.dateTP1.Value.ToString(“yy…
True DBGrid にて、カレント行の設定
True DBGrid にて、カレント行の設定 [C#] int i; this.c1TrueDBGrid1.Bookmark = this.c1TrueDBGrid1.RowBookmark(i);
C# 文字列を通貨型(decimal)に変換
using System.Globalization; //必衰 //文字列 string value = @”1,500,000″; //Decimalに変換 Decimal decX = De…
Substringにて、任意の位置から指定した文字数分の文字列を取出す。
1. 名前空間 using System; using System.Windows.Forms; 2. コード string s1 = “Hello, World!”; // 左端から 5 文字取り出す。 this.T…
BindingSourceのソート(並べ替え)
// Sort the items on the company name in descending order. BindingSource1.Sort = “Country DESC, Address …
TrueDBGridの項目を取得する
private void c1TrueDBGrid1_MouseClick(object sender, MouseEventArgs e) { //レコードをセレクト(マウスクリック) Sid.Text = c1Tru…