.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Showing available time slot in table format

Posted By:      Posted Date: August 27, 2010    Points: 0   Category :ASP.Net

I'm currently developing a system for booking of discussion room in a college. This system will allow the staff to help the students to make booking in advanced as well as for instant walk in usage.

I've got a table to keep track of bookings, another for walk in and one for time slot.

For the time slot table, it includes start time slot and end time slot, which is 30 minutes interval for each.

What i'm currently facing is that the system could not display the correct available time slot. I think it's the formula problem which I still can't get it solved.


If the booking time is 8.30am - 9.00am, I have no problem showing the 1st slot as N/A.

But if the time is 8.45am - 9.15am, the system only update the 1st slot as N/A while the 2nd slot still remain as AVAILABLE which is wrong. Because since the time ends at 9.15, I would like the slot 9.00am - 9.30am to be N/A as well.

This would be my code:

for (int x = 0; x < countTimeSlot; x++)
     if (int.Parse(arrEndTimeSlot[x].ToString()) > intBookedStartTime && int.Parse(

View Complete Post

More Related Resource Links

Table format of RadioButtonList


Hi All,

I have radiobuttonlist with 3 listItem, i need to give the table format to radiobuttonlist means it looks like table with row, how can i give, Any idea?

My code:-

<asp:RadioButtonList ID="RbAccount" runat="server" cssClass="Request">
<asp:ListItem Value="update" Selected="True">Change existing account </asp:ListItem>
<asp:ListItem Value="deprovision">Remove an account </asp:ListItem>
<asp:ListItem Value="new" Enabled="false">Create a new account </asp:ListItem>

If i am using this css style, it is giving me border all all the tables i have on page, i just want only this radiobuttonlist, Any idea ?

<style type="text/css">
    border:1px solid black;

Adding table to a page, but the format lost when I use clear border



I added a table to a page, by default, the table layout is the light border. So, I add my content and the vertical align seems to set to the top. But when I changed it to clear border, the content of the table will set vertical align to center. Is there a way to change this back to top align but with the clear border. I don't think I can do this by what is available in the ribbon. Please advice.

How to insert the Current date and time in to SQL Table..

Hello Members,              I have create the table as per the following ..create table company(  empname varchar(30),  empid int,  joindate smalldatetime)I tried,insert into table values('Kumar',202, ??????)I want to insert Current date and time into table Company.....Please give me the solution...Thanks.. 

Excel 2003 pivot table - parent showing grand total than the sum of its children

All, In Excel 2003, I have a product hierarchy, for simplistic sake lets say it goes A > B > C > model nbr.  I have filtered on model nbr 1.  I have the product hierarchy in my pivot table and unit cnt as the measure. Starting at level A in the hierarchy I am showing a total unit of 12000, if I drill down to B it still shows 12000, if I drill down to C it shows 100 and if I drill down to model nbr it shows me model nbr 1 with a unit cnt of 100. So my question is why are my parents not filtering the model nbr, it is taking the total for ALL records that have level A as their parent regardless of the model nbr? This does NOT happen in Excel 2007 or when I browse my cube in SSAS.

Repeating table not showing content following a rule refresh

Background info: I have a form where I populate employee info from the GetUserProfileByName ws. From there I populate its manager info from another web service call (seperate data connections).  Once the manager is populated, through rules, I'm populating the first approver. All this is done at form load through rules. The approvers node is defined as follows and is displayed on the form as a repeating table:  participants (group)    approver (repeating group)       ApproverName       ApproverLogin       ApproverEmail Problem: The repeating table is not showing any content even though I'm using an alert to show that I do in fact have one row in there. As a side note, I know the table is working because if the user elects to delegate approval to another user (through the people picker), the table shows these approvers correctly.  Anyone as any clue what I'm doing wrong? Thanks!    

Count numbers of days (no time table in datasource)

I read the following regarding adding a measure for counting the number of days: The trick is to create new measure group, which will have only one dimension - Time, and a measure with Aggregation Type 'Count' bound to the Day attribute of Time dimension (or any other attribute if we need to count something different from days). The most important setting on this new measure group is to leave IgnoreUnrelatedDimensions=true - this will allow to use this measure across any other dimension in the cube. Howerver, this solution assumes that one has a time dimension based on a table in the datasource. I have a Time dimension that created was by the BIDS wizard that is not in my source database but appearantly invisibly hidden on the AS server without direct access to it. (If I try to add a new measure group (as needed according to the post above) then I can only choose from tables that have nothing to do with time). Can somebody explain how I can do this without a specific timetable in my datasource? Do I need to add a timetable just for this purpose? Can it be stand-alone or do I need to add a relationship with all current tables that have date-columns in them? (I am a finance manager that is building a sales cube based on Navision 3.6, which is already working quite nicely, but still very much a newby)

How do I format a date time field in a CQWP to YY-MM-DD ?

Hi. I have been trying to get the date-time to look good for some time now, but have failed. I have a Content Query web part that picks up article pages from a page library. The pages contains a field called 'article date'. I want to show just the 'Title' and the 'Article date'. Doing this default gives me: My title 10-09-03 00:00:00 I want it to be: My title 10-09-03 Is this possible? I'm starting to realize that I probably have to edit the xsl styles for this webpart but if thats the answer, how do I do that? ThanksThomas Balkeståhl - Technical Specialist - SharePoint

TIME displayed in 24 Clock Format

I have a time field that is displayed via Reporting Services 2005, I want the TIME value to be displayed in 24 clock format. For example, 02:22:00 should be 14:22:00 How is this possible?? Thanks in advance

using Custom Formatter when format is unknown at design time

I have class "CF" that implements IFormattable interface. I can convert it to string var cf = new CF(); string str = cf.ToString("MYFORMAT", CultureInfo.InvariantCulture) or str = String.Format("{0:MYFORMAT}", cf);   the problem is that "MYFORMAT" is a parameter. so i can still use string fmt = "FORMAT"; string str = cf.ToString(fmt, CultureInfo.InvariantCulture) Is it possible still use String.Format for formatting? That doesnt work str = String.Format("{0:{1}}", cf, format)      

Time Format

Hi,Im trying to format time to this 10:00 AM. I tried:Eval("doma","{0:d}")Eval("doma", "{0:HH:mm}") Eval("doma", "{HH:mm}")Eval("doma", "{0:HH:mm tt}")  But it tells me:Exception Details: System.FormatException: Input string was not in a correct format.I think the problem might be that I'm use TIME form in SQL 2008 and maybe its expecting a long date/time format, maybe? But in any case it still should format at time, right? 

ReportViewer Not showing all data from table

Hello all,I am new to the forum and have done a search but can't seem to find anyone who has the same problem I do.  I am using ReportViewer with Visual Web Developer Express, I am doing a very simple query which should return two rows in the report.  Testing the query using query builder does return the two rows, but when I build and run the report it only shows the one row.  Hide duplicates is not turned on.  I can create a gridview not using the reportviewer and both rows appear after the build and run.The query:SELECT     defect_seq, ticket_numFROM         def2ticWHERE     (defect_seq = 15190002)ORDER BY defect_seqThis will return two rows when it is run against the database...Any ideas?  I have been killing myself trying different options..  Is there something built in to not show duplicates?  Am I enetering the fields wrong in the matrix?Also is there any good documentation on the ReportViewer for Visual Web express, besides the walkthrough?Thanks!!!!John

Databinding to table that has a custom format

My problem is that I have a different format table for each section in my form. And I would like to bind data to these tables. A repeater I don't think is going to work. It would be great if I can do it like this:<table id="exampleOfWhatIWant" runat="server"> <tr> <td><%# Eval("data") %></td> <td><%# Eval("data") + 1 %></td> </tr> <tr> <td><%# Eval("data") + 2 %></td> </tr> <tr> <td><%# Eval("data") + 3 %></td> <td><%# Eval("data") + 4 %></td> <td><%# Eval("data") + 5 %></td> </tr> </table> Where the "+ 1" is the next record from that datasource --which is bound in code behind. Is there anyway, I can accomplish this without resorting to dynamically created tables (ugh).

SSRS 2005 Render Format Excel Issue with Time Field


I have a report that uses a datetime field but gets populated only with the time. So, in SQL db, it gets stored with a default date value of 1899-12-30 12:01:01 with the correct time filled in. Report in SSRS Preview mode displays the value just fine when I use the Time format in Layout mode. I build and deploy and able to view the report in a web browser with no problem displaying the time field. But when I subscribe to the report and choose Excel render format, when I open up the Excel file from the email that was sent, I get negative decimal values. I have tried every possible Time format in SSRS but I get the same result. I also tried just the default and still gives me negative decimal values that show up as ####### in Excel.

Any help will be greatly appreciated. Thanks

epased time for few SQL queries is 0 in sys.dm_exec_query_stats table?



I get the elapsed time from sys.dm_exec_query_stats table for each SQL query that I run in MSSQL. I see that the elapsed time for some of the SQL queries are shown as 0 while oracle performance statistics data show some time for the same query.

I believe MSSQL can't take 0 microseconds to execute a query. Should I need to force MSSQL to monitor the lesser time taking queries?

I also used "SET STATISTICS TIME ON", I get 0 elapsed time from this too for those queries which had 0 elapsed time from sys.dm_exec_query_stats.

Any help will be helpful

15 minute incrementable UTC time inserts in the table


What is the most efficient way of creating a 15 minute increment table. This table needs to continue to increment with time so its not a static table.

While loop? how will that affect the performance, if I have to add dates starting 2005 till today and then basically after that with every hour a value needs to be added.. How can I go about doing that?




Insert data in parent and child table at the same time


I have two (parent-child) tables that are bound by a primary key (PK)/foreign key (FK) relation.each PK is identity (idStudent and idBac)

to insert data, i'm using an little application in c# i programmed myself where i insert these columns for the Student table: F_Name, L_Name, Age, Mobile, Adresse, City ,and  ( i don't know how to handle the idBac wich is foreign key of the other table wich still not inserted yet)

for the table Bac, i insert section, school, and city.

what i want is when i click on "OK" button, the idBac ,wich is a foreign key of the other table (BAC), receives the same idBac given the moment i inserted the BAC informations too ...

i don't have any problem wich ado.net ...i just want the right query/procedure.

thanks in advance and sorry for my english, it's not my mother tongue.

Adding rows in table at run time?



    I have a table which has few rows.

    A row contain few textboxes, one file upload field and a dropdown list in its cells.

    I want to make it a dynamic table that is i should be able to add extra rows in table at runtime, but I dont know how to do it.

    Please Help.

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend