I am fetching the values of "SystemID" from an xml. i.e. I am storing the values in a dictionary<string,string>,
I want to send null to the DB if the "SystemID" was not supplied in the xml i.e. the <SystemID></SystemID>
was not present in the xml.
Here is my code. But it's not working. Any Ideas!
sqlCommand.Parameters.Add("@SystemID", SqlDbType.Int).Value = string.IsNullOrEmpty(attributeValues["systemID"]) ? (object)DBNull.Value : Convert.ToInt32(attributeValues["systemID"]);