Last post Aug 25, 2010 04:39 AM by RaoYasir
Jul 23, 2010 01:47 AM|rickh78|LINK
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??
Web Application Project
"Web Deployment Project" MSCRM4.0
Visual Studio 2008
Jul 23, 2010 07:38 AM|sivaram.gn|LINK
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..
Jul 23, 2010 10:32 AM|rickh78|LINK
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.
Aug 05, 2010 02:02 AM|RaoYasir|LINK
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.
You can store timein directly into your attendace table, and on the timeout time just update the attendace table's timeout field.
Aug 05, 2010 09:12 AM|rickh78|LINK
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.
TIme Clock Help
Aug 06, 2010 12:45 AM|RaoYasir|LINK
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.
Aug 10, 2010 06:57 AM|rickh78|LINK
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.
Aug 25, 2010 04:39 AM|RaoYasir|LINK
Following is a simple algo for your requirements
It so simple, it might help you.