我搜索了很多,但找不到合適的解決方案。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
你可以在這個上下文中命名它。 –