【C#】日付について【Date】

当記事は以下の開発環境となりますのでご注意ください。
・Visual Studio 2022
・.Net 6.0
・C#
日付について日付をプログラムで扱う ...
【C#】数値について【Decimal】

当記事は以下の開発環境となりますのでご注意ください。
・Visual Studio 2022
・.Net 6.0
・C#
数値について数値をプログラムで扱う ...
【C#】数値について【Int】

当記事は以下の開発環境となりますのでご注意ください。
・Visual Studio 2022
・.Net 6.0
・C#
数値について数値をプログラムで扱う場合はIntク ...
【C#】文字列について【String】

当記事は以下の開発環境となりますのでご注意ください。
・Visual Studio 2022
・.Net 6.0
・C#
文字列について文字列をプログラムで扱う場合はSt ...
【C#】データテーブルとデータテーブルをマージする【DataTable】

「dt.Merge」を使用します。
今回は、HINMEI(品名)に対してプライマリキーの設定をしています。
※プライマリキーの設定がないと、正しくマージされないので注意です。 ...
【C#】データテーブルの行を別のデータテーブルに行インポートする【DataTable】

「dt.ImportRow(DataRow)」を使用します。
プロパティ設定、元の値、および現在の値を保持したまま、
コピー先のデータテーブルの末尾にインポートします。 ...
【C#】データテーブルの指定した位置に行追加する【DataTable】

「dt.Rows.InsertAt(DataRow, int)」を使用して、指定した位置に行を追加します。
第一引数のDataRowには、追加するためのDataRowを用意
第二引数のi ...
【C#】データテーブルの列インデックスを取得する【DataTable】

「dt.Columns.IndexOf(DataColumn)」を使用して、
データテーブルに格納されている列の位置を知る事ができます。
DataColumnは取得できているけど、どの位 ...
【C#】データテーブルの行インデックスを取得する【DataTable】

「dt.Rows.IndexOf(DataRow)」を使用して、
データテーブルに格納されている行の位置を知る事ができます。
DataRowは取得できているけど、どの位置、何行目にあるの ...
【C#】データテーブルを別のデータテーブルにコピーする【DataTable】

「dt.Copy()」を使用します。
既にあるデータテーブルをコピーして、
構造体もデータも同じデータテーブルを作成します。
//データテーブルの初期化 DataTabl ...