我一直在试图准确地找出语法错误的出处,并且我一直在寻找过去的答案,却找不到与我有关的错误。
string conStr = "Data Source=CPS1113020004; Initial Catalog=Coweta Public
Schools; Integrated Security=True";
var select = "SELECT Student_Number " +
"FROM dbo.[12 Grade Chromebooks] " +
"WHERE Student_Number = " + studentIDtxtBox ;
var c = new SqlConnection(conStr);
var dataAdapter = new SqlDataAdapter(select, c);
var commandBuilder = new SqlCommandBuilder(dataAdapter);
var ds = new DataSet();
dataAdapter.Fill(ds);
dataGridView1.ReadOnly = true;
dataGridView1.DataSource = ds.Tables[0];