我想在列中的所有值.. 這裏是我的代碼..如何獲取從數據表的列值到文本框?
private void btnLeftArrow_Click(object sender, EventArgs e)
{
if (con.State == ConnectionState.Open) { con.Close(); }
con.Open();
DataTable dt=new DataTable();
SqlCommand cmd = new SqlCommand("select * from Group_Name", con);
object obj = cmd.ExecuteScalar();
if (obj != null)
txtGroupName.Text = obj.ToString();
con.Close();
}
它僅顯示第一value..but我想其他值按鈕的每次點擊.. 我的表只有一列
檢查此鏈接:http://www.dotnetperls.com/sqldataadapter – noobob