Tech
Forums
Jobs
Books
Events
Live
Interviews
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
2
Reply
How to avoid time part from datetime datafield in access database using c#
Madhukumar Viswanathen
Aug 19 2011 2:37 PM
2.2k
Reply
hai all
i have ms access table named table1
id item stock price code stock_date model
1
ball
125
100
1
01/08/2011 12:00:00 AM
adidas
2
bat
150
1500
2
02/08/2011 12:00:00 AM
sii
3
stump
300
100
3
03/08/2011 12:00:00 AM
sii
4
pad
50
500
10
18/08/2011 12:00:00 AM
adidas
NULL
NULL
NULL
NULL
NULL
NULL
NULL
I want to find 02/08/2011 stock_date product details
I used below code
DateTimePicker1.value= 02/08/2011
oledcommand cmd = new oledd command("select * from table1 where stock_date="+ DateTimePicker1.value.ToShortString() +"",con);
In table1 stock_date have time part. So I cannot find the data. What changes I make in the code. please help me
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
C#.net code
[Help] How to insert data from the textBox to MySQL Database in C#