这是我的代码:
private void textBox1_TextChanged(object sender, EventArgs e)
{
//**************************************
int aa = textBox1.Text.Length;
var qry = (from p in dc.Products
where p.ProductName.Substring(aa) == textBox1.Text.Trim()
select p).ToList();
productDataGridView.DataSource = qry;
}
当我在文本框中输入一个字母时,数据网格变为空