Click here to Skip to main content
15,942,964 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Vendor_Name	nvarchar(MAX)	Checked
Asset_Type	nvarchar(MAX)	Checked
New	real	Checked
Refurbish	real	Checked
Repaired	real	Checked
Date	date	Checked
		Unchecked

This is my database design. I want to select the rows according to recent date or last updated date . how to write a select query in c# for that
Posted
Updated 1-May-14 23:19pm
v2
Comments
Richard MacCutchan 2-May-14 5:22am    
You only have one date field so how can you distinguish between recent and last updated?

its not possible you have to add 4 extra column

Createdby,createdon,updatedby,updatedon

or atleast createdon,updatedon column.
 
Share this answer
 
v2
Assuming your table name is Vendor simple SQL query would be
SQL
select * from Vendor order by Vendor.Date desc

MSDN[^] provides info about creating and executing SQL queries in C#.
 
Share this answer
 
v2

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