Click here to Skip to main content
15,917,568 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i want to enter the date in textbox and only that date's data will be display
Posted
Comments
Bh@gyesh 16-Apr-14 1:29am    
Please specify your requirement in detail. Means you want to display data from database?
Member 10694442 16-Apr-14 1:51am    
yes

try this,

select * from [dbo].[table_name] where DocDate='DateTextfieldname'
 
Share this answer
 
Comments
Member 10694442 16-Apr-14 1:45am    
first i tried this but its not working
you can by using linq to do like this

DataContentDataContext db = new DataContentDataContext ();
C#
var result  = from p db.MyTableName
              where p.FieldDate =  Convert.ToDateTime(txtbox.text)
              select  p ;


if using SQL you can create stored procedure and then calle it execute your query

SQL
CREATE PROCEDURE Get_Data_By_Date 
	-- Add the parameters for the stored procedure here
	@Docs_Date datetime   
 
AS
BEGIN
	  SELECT * from YourTable where docDate =@Docs_Date 
END
GO
 
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