SqlCeConnection con1=new SqlCeConnection(@"Data Source=C:\\Users\\Ahmed\\documents\\visual studio 2010\\Projects\\WindowsFormsApplication6\\WindowsFormsApplication6\\Database1.sdf");
con1.Open();
SqlCeDataAdapter com1=new SqlCeDataAdapter("select * from Customer where Size No = "+textBox1.Text,con1);
DataTable dt = new DataTable();
com1.Fill(dt);
dataGridView1.DataSource = dt;
con1.Close();
答案 0 :(得分:3)
因为Size No
它不应该有空格,只要是下划线或其他任何东西,只要它是你的列名。