2 つのテーブルがあるCustomer
としCustomer_address
ます。クエリから 1 つのデータ テーブルを作成するのは簡単ですが、1 つの結合クエリで 2 つの異なるデータ テーブルを作成することは可能ですか?
例:
OleDbDataAdapter adapter = new OleDbDataAdapter();
adapter.SelectCommand = new OleDbCommand("SELECT a.CustomerID, b.CustomerEmail FROM Customer a INNER JOIN Customer_address b ON a.CustomerID = b.CustomerID WHERE a.CustomerID = 3", this.connection);
DataSet ds = new DataSet();
adapter.Fill(ds, "Customer");
今、私はCustomerID
とCustomerEmail
を持っていds.Tables["Customer"]
ます。
2 つの異なるクエリを作成せずCustomerID
に inTables["Customer"]
とCustomerEmail
inを使用することは可能ですか?Tables["Customer_address"]