Skip to content

Tag: winforms

C# is adding 00:00:00 unnecessarily

My SQL Server is using the DATE datatype, but my C# app is reading this as ‘mm/dd/yyyy 00:00:00’, can anyone tell me how to get rid of the 0s? (everything else works)…? Answer If you don’t want the time portion of a DateTime as String you have several options: Read: Date and time forma…

How to calculate employees working hours in sql

My company business hour is 7:30 to 18 and 13:00 to 15:00 is lunch time. Important part is about lunch time that should not calculate as working time of employee at all. So imagine employee start working at 8:30 and exit at 15:00 so the time of 4:30 hours should be calculate for him. actually I want to remove…

Execute query and populate the same in datagrid Box

I have a winform app connected to access database as data source , but in access i was using this below SQL to generate a query table called trend: But i do not know how execute this & populate the same in datagrid box on form load event(dataset:CSCdataset) , please help me. Answer I guess you can find mo…