我想將整數值存儲在標籤中並傳遞給另一個表單。但價值獲得通過,但它通過system.data.dataset
。以下是我的代碼。請幫我解決一下這個。從數據庫中獲取數據並傳遞給另一個表單
con.Open();
SqlCommand cmd1 = new SqlCommand("select balance from customer where namee='" + textBox1.Text + "'", con);
SqlDataAdapter adapter = new SqlDataAdapter(cmd1);
DataSet ds = new DataSet();
adapter.Fill(ds, "loki");
label4.Text = ds.ToString();
options frm = new options(label4.Text);
frm.Show();
con.Close();
有什麼問題爲int? – 2012-07-26 08:06:36
將TextBox的*修飾符*設置爲* public *並以第二種形式寫入* code *。 – adatapost 2012-07-26 08:07:43
你已經分配了System.Data.Dataset標籤並將其傳遞給另一個表單 – 2012-07-26 08:07:59