locked
VS 2008 Web Application Project RRS feed

  • Question

  • User977786652 posted

    Hi, I am working on a VS time clock project to be used for student's to clock in and out. When the student clocks in the time/date is saved to a temp table. Upon login out to the login screen for the next user to use I need to save the clocked in time to a permanate table. It is an update from the temp table to the permanate table. However, when the page redirects to the login page, I recieve the dbnull to date is invalid error. Now understand, when the page is redirecting to the login page for the next user, the only way I could figure out to get the browser to forget the sessionstate, was to use a delete statement that removes the data from the perm table, but before it erases it, I need to save it to the permanate database table.

     

    Anyone have a solution they can send my way??

     

    Thanks :) 

    Friday, July 23, 2010 1:47 AM

Answers

  • User-979828334 posted

    Following is a simple algo for your requirements


    1. Student Log in
    2. System will check wheather already there is entry for that student in system and have blank timeout field
    3. if entry exist then not the time and update the timeout field for that student
    4. If entry does not exist then enter a new entry in attedance table with blank timeout field


    It so simple, it might help you.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, August 25, 2010 4:39 AM

All replies

  • User1077589411 posted

    Hi..

    Check if this is helpful..

    " the only way I could figure out to get the browser to forget the sessionstate" -  You can use Session. Abandon method to kill the current session....

    "I recieve the dbnull to date is invalid error" - It might be a DB error. Check if you are trying to insert null for a date...

    ---------------

    Mark as answer if this helps..

    Friday, July 23, 2010 7:38 AM
  • User977786652 posted

    I have tried the session .abandon and it didnt work. I have found that by using a delete statement to remove the session when erthe page redirects to the login page. But, I need to have it update another table with the data before it deletes it. User clocks in, the gridview shows time in, log out button is clicked, page redirects to login(deleting data as it redirects), when the log out button is clicked, I need to update from the current TimeSheet table to the new_timesheet table, then the data is deleted. But, when I click the logout button and the data is supposed to update the other table, I get the dbnull to date in not valid error. How can I capture the data from one table to store it in another, all before the logout action and deleting of the data takes place?


    Thank you for your response.


    Friday, July 23, 2010 10:32 AM
  • User-979828334 posted

    You have been going to implement the some extra work in your application. You can perform the same operation with little change in your logic.

    You are currently storing timein in temp table, whe student enter timeout then you will update the attendance table with timein and timeout. in this logic you are doing extra work of storing values in temp table.


    Alternatily,


    You can store timein directly into your attendace table, and on the timeout time just update the attendace table's timeout field.

    Thursday, August 5, 2010 2:02 AM
  • User977786652 posted

    Well, the problem to begin with was after a student would login and the page would refresh back to the login/default page, I could not figure out how to make the app forget the sessionstate. If the same employee were to come back a few hours later and try to clock out, it would not let them because it still held the sessionstate, cookie, etc.... If another student was to clock in it will work, but if the same student tries to clock out, it does not store the timeout because of the sessionstate. This application will run on a stand-alone machine and will not be shut down until the end of the day. With the current way listed above, you would have to close out the application and re-start it just to allow the returning student to clock out. That is not how I am trying to make this app run and my Super does not want it like that either. So, I am trying to find a way to make the exit button(which returns the student to the login) pull the info from the temp table and store it in a permanate table, this way the application never has to be closed and the session is always removed for the returning student to logout when their shift is over.

     

    Thanks for the replies all. 

    Thursday, August 5, 2010 9:12 AM
  • User-979828334 posted

    Rickh,

    its not so much complicated as your are making it, first remember following things

    its just a timein and timeout recording page, so

     you dont have to store sessions

    when an employee or student comes he puch his card or thumb or what ever method your are using

    your application will read his id and make an entry in attendance table,

    when same card will punch again you have to upate the attendance table timeout field.

    To implement this you have to make a check in your application programing that whenever a card is punched then check wheather there is any record in attendance table with the same id exists and timout field is empty then mark timeout otherwise mark timein


    I think this will clear a logic for you to record timein and timeout, and not using the sessions.


    Friday, August 6, 2010 12:45 AM
  • User977786652 posted

    Thanks for the information. I have it to where it will save without using the sessionID, but when I want the same student to logout I have to close out the whole application and restart it just to get the timeout to save to the database table. How can I make the login page stop remebering who has clocked in? After they clockin it shows them the time they have clocked in in a gridview. Then exit or logout is clicked and the page redirects to the login page, but it is remembering who has clocked in and the only way it will let the clock out is to close the application and restart it; I want to have it forget who clocked in when the page redirects to the login after each login.

     

    Thanks

    Tuesday, August 10, 2010 6:57 AM
  • User-979828334 posted

    Following is a simple algo for your requirements


    1. Student Log in
    2. System will check wheather already there is entry for that student in system and have blank timeout field
    3. if entry exist then not the time and update the timeout field for that student
    4. If entry does not exist then enter a new entry in attedance table with blank timeout field


    It so simple, it might help you.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, August 25, 2010 4:39 AM