Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
private void button5_Click(object sender, EventArgs e)
{
bs.DataSource = dataGridView2.DataSource;
bs.Filter = string.Format("select * from sales_details where date between '"+dateTimePicker2.Text+"' and '" +dateTimePicker3.Text+"'");
dataGridView2.DataSource = dt;
}
Posted
Updated 9-Dec-14 20:36pm
v2
Comments
BillWoodruff 10-Dec-14 2:55am    
How can we help you if you don't tell us how your code is not working, what the error message is, where the error message occurs, or how the results are not what you expected ?
Muhammad Qasim Ludin 10-Dec-14 21:31pm    
incorrect invalid operator near "sales_deatils"

1 solution

 
Share this answer
 
Comments
Muhammad Qasim Ludin 10-Dec-14 2:54am    
but brother I need to filter data in datagridview by date rang mean when I am entering from date to date it should show records between the related dates thanks !

like I used sql server between query !
Maciej Los 10-Dec-14 2:56am    
Have you visited the link i provided? There is a sample which meets your criteria.
;)
Muhammad Qasim Ludin 10-Dec-14 3:10am    
brother but not any one helpful

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900