how to insert the record into the database by date/time .The same id will not inserted another time until a month over..
For example, take salary detail if we inserted employee by the employee ID with date/time in the database about the salary detail ..the same person Id could not inserted again until the one month....If one month over we can insert the same faculty details again...
Thanks in Advance
Loading

Dorababu MekaRank #457 · 5.5K reputationPosted May 11, 2011, 1:50 AM EDT
Vijay YadavRank #1,637 · 943 reputationPosted May 11, 2011, 2:12 AM EDT
I have done the same thing in my project.
Like this,
int i = 0;
int x = DateTime.Now.Month;
int y = DateTime.Now.Year;
if (x == 12)
{
i = 1;
y = y + 1;
}
else
i = DateTime.Now.Month + 1;
int m=DateTime.DaysInMonth(y,i);
string s = i + "/01/" + y + " 12:00:00 PM";
string ss=i+"/"+m+"/"+y +" 11:59:59 PM"; // the date format is in yyyy/MM/dd hh:mm:ss
then your select query
for example: select Emp_Name from table where date between 's' and 'ss'
Vijay YadavRank #1,637 · 943 reputationPosted May 11, 2011, 2:13 AM EDT
Sam HobbsRank #107 · 20.5K reputationPosted May 11, 2011, 6:08 PM EDT