Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- BindingSource bs = new BindingSource();
- bs.DataSource = dataGridView1.DataSource;
- bs.Filter = columnNameToSearch + " like '%" + textBox1.Text + "%'";
- dataGridView1.DataSource = bs;
- dtData.Select("TicketID = 1")
- //...
- StringBuilder query = new StringBuilder();
- query.AppendLine("SELECT TicketID, Name, Company, Product");
- query.AppendLine("FROM YourTable WHERE 1=1");
- if (txtSearch.TextLength > 0)
- {
- query.AppendLine("AND TicketID = @TicketID");
- //Here add sqlparameter with textbox value
- }
- //... and so on
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement