C# 怎样把从两张关联的表查询出的数据显示在不同的TextBox?
private void button1_Click(object sender, EventArgs e)
{
string syokuzaijancd = comboBox2.Text.ToString();
DBConn dbConn = new DBConn();
conn = dbConn.Conn();
string sql = "select * from M041_TBL where SYOKUZAIJANCD='" + syokuzaijancd + "'";
OleDbDataAdapter da = new OleDbDataAdapter(sql, conn);
DataSet ds = new DataSet();
da.Fill(ds, "M041_TBL");
DataTable dt = ds.Tables["M041_TBL"];
this.textBox2.Text = dt.Rows[0]["SIYOURYOU"].ToString();
}
一个表的时候我可以这样,那这种string sql = "select a.JANCD,a.SIIREGENKA,a.HINNM,b.SIYOURYOU from M003_TBL a,M041_TBL b where a.JANCD=b.JANCD 怎样显示呢??
C#菜鸟求助 高手勿盆!!! 先谢谢各位!!!
------解决方案--------------------