private void pnamebox_TextChanged(object sender, EventArgs e) { string key = pnamebox.Text.Trim(); DataTable dt = new DataTable(); dt = sf.Search(key); stocklist.DataSource = dt; }
private void button3_Click(object sender, EventArgs e) { String s = searchbox.Text.Trim(); if (s != "") { DataTable dt = cf.Search(s); productlist.DataSource = dt; } else { DataTable dt = cf.Select(); productlist.DataSource = dt; } }