The current design breaks normalization rules. The Hours and Day values can be calculated from the IN and OUT column on request. There is no need to have Hour and Day columns in the table. This will simplify the code and there will be less chance of data
bugs.
Member
55 Points
149 Posts
How to change gridview cell value on the basis of condition
Jan 01, 2019 02:04 AM|akhterr|LINK
I have gridview in which INTIME ,OUTTIME ,HOurs and Day column are available and i am directly inserting value from gridview into database.
Now i want on update button click Hours and Day value must be equal to 0, if INTIME or OUTIME does not excit in gridview cell .please guide
All-Star
43841 Points
18766 Posts
Re: How to change gridview cell value on the basis of condition
Jan 01, 2019 03:10 PM|mgebhard|LINK
The current design breaks normalization rules. The Hours and Day values can be calculated from the IN and OUT column on request. There is no need to have Hour and Day columns in the table. This will simplify the code and there will be less chance of data bugs.
All-Star
52312 Points
15574 Posts
Re: How to change gridview cell value on the basis of condition
Jan 01, 2019 03:39 PM|oned_gk|LINK
Like another said, you don't need to save the result manualy, use calculated field or direct query.
To replace null result for null in/out value use ISNULL() function
Suwandi - Non Graduate Programmer
Participant
1300 Points
522 Posts
Re: How to change gridview cell value on the basis of condition
Jan 02, 2019 06:19 AM|Wei Zhang|LINK
Hi akhterr
According to your description,I couldn't understand your requirements clearly.Is INTIME OUTTIME from a table in database or else?
Do you want to change the value of cells or want to change data in Database?So,could you please post more details about your code?
It will help us to solve your problem quickly.
Best Regards
Wei Zhang