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"]とCustomerEmailinを使用することは可能ですか?Tables["Customer_address"]