I have a WS that has a method in which a list of nodes with some data is inserted. I get these data as XmlDocument , I run the Parameters node by reading the contents inside it, after that I get the data and fill in the parameters of my Procedure to insert into the base. Home But there is a possibility that the data sent via WS is null, the node is not created, and when I try to read the error node. How can I check if the node exists and not enter NULL in the Procedure parameter?
I'm using the code that I'm using to validate this, but it returns error
cmdMailingRetorno.Parameters.AddWithValue(
"@DataHoraFim",
Telefones[i]["DataHoraFim"].HasAttributes ?
(DateTime?)null :
Convert.ToDateTime(Telefones[i]["DataHoraFim"].InnerText)
);