私には2つのクラスがあります。返されるクラス2のデータテーブルを作成しました。クラス1でこれらの値をどのように使用できるかを理解しようとしています。クラス1の別のメソッドでデータテーブル値を渡す必要があります。
//例:クラス2には次のものがあります:
public Datatable Mytable()
{
DataTable table = new DataTable();
table.Columns.Add("Column1", typeof(string));
table.Columns.Add("Column2", typeof(string));
//get values for the data row here
return table;
}
クラス1では私は持っています:
public Method1 (String A, String B)
//A and B need to represent the values in the Datatable from Class 2
{ string ab = "This is first datarow " + A + " This is second datarow " + B;
}