我有两张桌子,table1
和table2
。我想column1
从. table1
_ 然后结合这两个结果并在网格视图中显示为单独的列。这是我的代码:column1
table2
string query4 = "select tablename from table1 where tid='1'";
MySqlCommand command4 = new MySqlCommand(query4, connection);
DataSet ds = new DataSet();
adapter.SelectCommand = command4;
adapter.Fill(ds);
GridView1.DataSource = ds;
GridView1.DataBind();
string query5 = "select fname from table2 where id='1'";
MysqlCommand command5 = new MySqlCommand(query5, connection);
DataSet ds2 = new DataSet();
adapter.SelectCommand = command5;
adapter.fill(ds2);
Gridview1.DataSource = ds;
这给了我唯一table1
的价值,但我想在单个网格视图中table1
显示两列。table2