Hi @Raj Shekar ,
Do you want to create a new item in a task List using CSOM? If my understanding is incorrect, please contact me.
If yes, according to my research and testing, you can refer to the following code to achieve it:
List targetList = context.Web.Lists.GetByTitle("task");
ListItemCreationInformation oListItemCreationInformation = new ListItemCreationInformation();
ListItem oItem = targetList.AddItem(oListItemCreationInformation);
oItem["Title"] = "test2";
oItem["DueDate"] = DateTime.ParseExact("2022-09-22 08:00 AM", "yyyy-MM-dd HH:mm tt", null);
oItem["StartDate"] = DateTime.ParseExact("2022-09-21 08:00 AM", "yyyy-MM-dd HH:mm tt", null);
oItem.Update();
context.ExecuteQuery();
My test result:
More information for reference: Create List Item in SharePoint using CSOM
Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.