Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET
Hi all
 
i am displaying attendance detail in a gridview..but i want only one days entry..
means today what ever i am entering it should show that only..tomorrow if i open the form it should be an empty grid..
grid contains each days data only...
 
please tell me how to do this..
Posted 25-Sep-12 19:47pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

if you are ferching data from sql server or any backend to dispaly in gridview then you have to write query for that. Query should fetch the current dates data.
like
select * from table_name where date = getdate()
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Hi,
 
datagridview shows the data when we assign any table of dataset to it so if you are retreiving the date of attendance by a query so please put a where condition with date and compare it with Now.date so it will display the data of the current date and at the start of the day there will be no data so it will show an empty grid.
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

For this you need to alter the way you are fetching data to bind the grid view.
For example, if you are using a stored procedure, you need to add certain condition , so that it will fetch only current date's data only.
And again , you should have a column in the table which will store the current date when you insert a new data to the table.
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

u can do it in query level..pass he required date in query and then bind that data to the grid
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 435
1 Maciej Los 335
2 OriginalGriff 278
3 CHill60 180
4 Sinisa Hajnal 180


Advertise | Privacy | Mobile
Web01 | 2.8.141022.2 | Last Updated 14 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100