Here is the C# .NET code to prepare the xml to be sent to sproc.
Code:
con.Open();
SqlCommand cmd = new SqlCommand("ScanResults", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@doc", SqlDbType.NText).Value = XMLReturn;
SqlDataAdapter adp = new SqlDataAdapter(cmd);
adp.Fill(dataset, "ID");
con.Close();
Code:
CREATE PROCEDURE [csTest].[ScanResults] (@doc ntext) AS DECLARE @iTree int EXEC sp_xml_preparedocument @iTree OUTPUT, @doc ~buncha crap~ EXEC sp_xml_removedocument @iTree RETURN
