-
Jul 28th, 2014, 11:17 PM
#1
Thread Starter
Frenzied Member
Gest way to show this in a gridview?
Hello,
I don't know if this is more of a database question or for here. What I need to do is list records of data in a gridview from a SQL table. Yes, I already know how to do this with a SQLdatasource control. But here is my problem. I need to list them in time order starting with 12:00AM through the whole day every half hour. My problem is in the table I only have the half hour times that the person worked. And I need to list every half hour even if they did not work. The other fields going with each time is Activity1 and Activity2. I only have records that has the activity in the table.
So do I need to create a datatable from the SQL data and then fill in the missing times? Or is there a better way to do this?
Thanks,
Warren
-
Jul 28th, 2014, 11:35 PM
#2
Re: Gest way to show this in a gridview?
One option would to use your SQL code to create a result set that contains all the half-hour blocks and then outer-join that with your existing data. That will create a result set that includes all the periods worked or not and then you use the SqlDataSource as normal.
-
Jul 29th, 2014, 01:57 AM
#3
Re: Gest way to show this in a gridview?
+ You shouldn't be using SQLDatasource in the first place. An evil control that bloats your page(discussions have been made hundreds of time so i won't go to details).
ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·
-
Jul 29th, 2014, 11:25 AM
#4
Thread Starter
Frenzied Member
Re: Gest way to show this in a gridview?
Thanks. I use the SQLDataSource control all the time for when I need to bind a stored procedure to a grid. It is much easier than coding to query data by code, put it in a datatable and then bind it. I use the Telerik asp.net control set and love it!
Warren
-
Jul 29th, 2014, 11:34 AM
#5
Re: Gest way to show this in a gridview?
Hi,
Well I agree on Sapator on not using SQLDatasource control. So, did @jmcilhinney answer in post #2 helped you
with your problem?
KGC
-
Jul 29th, 2014, 11:36 AM
#6
Thread Starter
Frenzied Member
Re: Gest way to show this in a gridview?
I am actually about to try doing that. I'll reply back in a bit with the results but definitely makes sense.
Warren
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|