SqlConnection connect = new SqlConnection("Data Source=m**-PC; Initial Catalog=Mydb; Integrated Security=True");
DataSet set = new DataSet();
SqlDataAdapter data = new SqlDataAdapter();
connect .Open();
data.InsertCommand = new SqlCommand("SELECT Yazi FROM Ozgecmis", connect);
data.Fill(set, "Yazi");
connect.Close();
int sayi = set.Tables["Yazi"].Columns.Count;
TextBox1.Text = Convert.ToString(sayi);
我将数据集获取数据并添加表格,因此我将学习计算列表并编写 texbox1
我不接受sayi,但我没有错误。出了什么问题?