@Gani_tpt , based on my test, I find that I can still convert your xml value to DateTime field by your code.
I used the following database design:
Also, I used the folllowing code:
DataSet dataSet = new DataSet();
dataSet.ReadXml(@"C:\Users\username\Desktop\test1.xml");
string connstr = @"connstr";
SqlConnection connection = new SqlConnection(connstr);
connection.Open();
SqlBulkCopy copy = new SqlBulkCopy(connection);
copy.DestinationTableName = "Employee";
copy.ColumnMappings.Add("EmpRetired", "EmpRetired");
copy.ColumnMappings.Add("CurrentStatus", "CurrentStatus");
copy.ColumnMappings.Add("DateRelieved", "DateRelieved");
copy.ColumnMappings.Add("EmpId", "EmpId");
copy.ColumnMappings.Add("SearchRes_Id", "SearchRes_Id");
copy.WriteToServer(dataSet.Tables["Employee"]);
If the answer is the right solution, 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.