Hello. It is required to create xml and write not the data but the xml file itself into the Oracle table. I read that to store the file in the table there are types of clob or xmltype. Created a table with this field. And the problem is loading the file there directly with the code.

String str = "D:\\file.xml"; XmlTextWriter textWritter = new XmlTextWriter(str, Encoding.UTF8); textWritter.Formatting = Formatting.Indented; textWritter.WriteStartDocument(); textWritter.WriteStartElement("NAME"); textWritter.WriteString(TextBox1.Text); textWritter.WriteEndElement(); textWritter.Close(); 

This is the creation of an xml file. And this is how I try to add it to the table.

 con.Open(); OracleCommand com = new OracleCommand("insert into test3 (name) VALUES ('" + textWritter + "')", con); com.ExecuteNonQuery(); con.Close(); 

But as I understand, textWritter does not contain the file itself. What do I need to substitute values ​​instead of what would be the file written in the table. Thanks in advance.

  • In Oracle it is possible to save also in XML. See XMLDB. How to do this from c # I do not know. - 0xdb
  • The question remains open, if someone knows how to do this please tell me. Because everything that so far is only like data from xml read into the table but not the file itself. - Andrei

0