使用  Select A.*,B.* from table1 A  left join table2 B on B.t1_id=A.t1_id 
where A.t1_id=???

解决方案 »

  1.   

    Select * from table2 where t1_id in (Select t1_id from table1 where t1_name='" + textBox_country.Text + "')"; 
    执行一次或通过DataRelation实现关联
      using (OleDbConnection con = new OleDbConnection(cn))
                {
                    DataSet ds = new DataSet();
                    OleDbDataAdapter dr1 = new OleDbDataAdapter("select * from A", con);
                    OleDbDataAdapter dr2 = new OleDbDataAdapter("select * from B", con);
                    dr1.Fill(ds, "tb1");
                    dr2.Fill(ds, "tb2");
                    ds.Relations.Add("", ds.Tables[0].Columns["id"], ds.Tables[1].Columns["ID2"]);
                      }
      

  2.   

    同上表之间的逻辑通过sql语句来完成。来得到一张表。OleDbDataAdapter.fill()只能关联一张表的