I finally came to know why I did not see updated timestamp (Last login date and time) but still my problem is not solved.
Actually, I included the database file (MS Access) in my project. Now my connection string is as:
="1.0"="utf-8"
<configuration>
<connectionStrings>
<add name="constr" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\DATA.mdb" />
</connectionStrings>
</configuration>
So in connection string the path is not absolute (like C:\SomeFolder\MyDatabasefile.mdb). Moreover I have an app.config file which contains this code so entire project uses same connection string and no chance for two different connectionstrings.
Now my problem is that even the Login is made, the timestamp (Last Login Date and Time) does not change. I observed very strange thing which was its reason. It was that after the Database file (from other location) was included in my project I found a new copy of that database file in my application folder (as normal) along with folders like “bin”, “obj”, ”Properties”, “Resources” and various other .cs files. When my application loaded from Visual Studio IDE it created all necessary files in bin\debug and among these files was also the Database file. So now in my project folder I have two copies of database file. Now the strange part was that when my application loaded from Visual Studio it used the Database file which was present outside bin\debug folder with other .cs files and folders like “bin”, “obj”,”Properties”, etc. and after login successful the Timestamp of that database was shown to me which never updated because the change was always made in the database file present in the bin\debug folder with the compiled .exe file. I was really shock to observe that the database file used to read and write is different. I did not agree that and I confirmed that by making changes in that database file (explicitly opening and making changes in it) which was present outside bin\debug folder with other .cs files, I found that timestamp had change in it. This way I got known reason although strange.
The explicit running of .exe files is perfect but running application from Visual Studio makes such issue which uses one database for reading data and other to write!
I can’t understand reason or logic just think or guess that may be this goes due to not using the absolute path (like C:\SomeFolder\MyDatabasefile) I find two database file access simultaneous.
I can’t see updates in database while building it and each time run .exe file explicitly to check that my coding is perfect or not. I tried using absolute path in connection string like (C:\Somefolder\MyDatabasefile.mdb) which works perfect. So is it I have no other option than to change my connectionstring path type and after completion of project change path type to same as now (relative) or any other solution for it?