INSERT INTO TableName (TaskID, UserID, ReminderDate, Task, TaskType, EmailID) SELECT TaskID + 1 AS TaskID, UserID, ReminderDate, Task, TaskType, EmailID FROM TableName WHERE ReminderDate = GETDATE()
SqlConnection con = new Sqlconnection("conn"); SqlCommand cmd foreach(GridViewRow rw in Gridview1.rows) { Textbox txtrmddate = (Textbox) rw.FindControl("ReminderDate"); Dropdownlist ddltasktyp = (Dropdownlist) rw.FindControl("TaskType"); if (convert.Todatetime(txtrmddate) == Datetime.Now.tostring("dd/MM/yyyy") && ddltasktyp.selectedItem.Text == "Daily" ) { con.Open(); cmd = new Sqlcommand("Insert into tblnam (UserID,ReminderDate,Task,TaskType,EmailID) Values (1,'"+ txtrmddate .text +"','Task','"+ddltasktyp.selectedItem.Text+"','EmailID')",con); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)