才能一個數據列的值分配給一個變量和以不同的方法使用該變量。 我有以下代碼如何一個DataColumn值分配給一個變量和使用該變量在不同的方法
button_click()
{
create and fill data set as data adapter.fill(data set,"ABC");
and then
int x= data set.tables["ABC"].rows[0]["col name"] ;
}
and i have another method button_click2()
{
int y = x;
}
我可以這樣做嗎?或者是有什麼辦法可以指定數據set.tables [「ABC」。行[0] [「山口名」]值直接爲x
是的,你可以將一個變量分配給另一個。你嘗試過嗎?問題是什麼? – vittore
這worked.thanx大家 – laila