Click here to Skip to main content
15,901,205 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a table called selling, with a column called DateTime in it which, cunningly enough, contains date and times. Now, I want to filter my DataGridView, but when I press the button to filter the item, the Windows Forms application freezes.

Here's my query:
private void button1_Click_1(object sender, EventArgs e)
{
  sellingBindingSource1.Filter = string.Format(
    "SELECT * FROM Selling WHERE DateTime BETWEEN '10/21/2010' AND 
    '10/22/2010'");
}
Posted
Updated 23-Oct-10 4:42am
v2
Comments
T.Saravanann 23-Oct-10 10:20am    
SELECT * FROM Selling WHERE DateTime BETWEEN '10/21/2010' AND '10/22/2010'") in this line DateTime means ColumnName or DataType.
lester555 23-Oct-10 10:23am    
i know. i have column with name datetime in selling table
T.Saravanann 23-Oct-10 10:52am    
Check the same query in your database,may be no.of records are huge.
Abhinav S 23-Oct-10 11:45am    
Check you connection settings as well - make sure you can connect to the database.
lester555 23-Oct-10 12:19pm    
its work fine in database query. my connections is ok.

1 solution

You can see this link

Click

Click

Click
 
Share this answer
 

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



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