我搜索了很多,但找不到合适的解决方案。mysql选择加入数据集和c#中的数据表#
比方说像生病选择数据:
using(MySqlConnection connection = new MySqlConnection(MyConnectionString))
using(MySqlCommand cmd = connection.CreateCommand())
{
connection.Open();
cmd.CommandText = "SELECT a.Id, a.Foo, b.Bar FROM tableA a, tableB b where a.Id = b.Id";
MySqlDataAdapter da = new MySqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
DataTable dt = ds.Tables[...]; //<== here is the problem
}
,我想将它添加到DataTable,
如何调用表在这种情况下?
是tableA吗?
重要的是我怎么命名它?(我可以把它命名为foobar吗?)
正常的一个明确的问题,但总有一个devoter,不能评论这....很伤心!我不知道为什么应该关闭这个问题^^ – Dwza
你可以在这个上下文中命名它。 –