1
 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();
4

1 回答 1

3

正因为如此Size No

它不应该有空格,而是下划线或任何内容,只要它是您的列名即可。

于 2013-04-27T08:25:44.260 回答