Для тех, кто использует XMLTextWriter для создания XML, необходимо использовать кодировку UTF-16 (Unicode в .net) Итак, вот код для создания XML.
' create xml file for folders
strmFolderList = New System.IO.MemoryStream()
wrtFolderList = New System.Xml.XmlTextWriter(strmFolderList, System.Text.Encoding.Unicode)
' start document and add root element
wrtFolderList.WriteStartDocument()
wrtFolderList.WriteStartElement("Root")
' cycle through folders
For intIndex = 0 To m_intAdditionalFolderQuantity - 1
' figure out folder description
strFolderDesc = m_arrFolderDesc(intIndex)
' add element to xml
wrtFolderList.WriteStartElement("Folder")
wrtFolderList.WriteAttributeString("folderdesc", strFolderDesc)
wrtFolderList.WriteAttributeString("insertfolder", ((intIndex + 1) * -1).ToString())
wrtFolderList.WriteEndElement()
Next
' close root element and document
wrtFolderList.WriteEndElement()
wrtFolderList.WriteEndDocument()
wrtFolderList.Close()
'System.Text.Encoding.Unicode.GetString(strmFolderList.ToArray())
А вот код для вызова хранимой процедуры
cmdAddRequest = New System.Data.Odbc.OdbcCommand
cmdAddRequest.CommandType = CommandType.StoredProcedure
cmdAddRequest.CommandTimeout = 60
cmdAddRequest.CommandText = "{CALL uspAddRequest ( ?, ?, ?, ?, ?, ?, ?, ?, ?)}"
' add parameters to odbc command
cmdAddRequest.Parameters.Add("@ruserid", OdbcType.VarChar, 8).Value = SafeODBCParamString(m_strUID)
cmdAddRequest.Parameters.Add("@rmatter", OdbcType.VarChar, 15).Value = SafeODBCParamString(m_strMatterNumber)
cmdAddRequest.Parameters.Add("@req_tkinit", OdbcType.VarChar, 8).Value = SafeODBCParamString(m_strRequesting)
cmdAddRequest.Parameters.Add("@ret_tkinit", OdbcType.VarChar, 8).Value = SafeODBCParamString(m_strReturnNumber)
cmdAddRequest.Parameters.Add("@requestor", OdbcType.VarChar, 20).Value = SafeODBCParamString(m_strRequestor)
cmdAddRequest.Parameters.Add("@labels_only", OdbcType.Bit).Value = m_blnLabelsOnly
cmdAddRequest.Parameters.Add("@folder_quantity", OdbcType.SmallInt).Value = m_intAdditionalFolderQuantity
cmdAddRequest.Parameters.Add("@folder_list", OdbcType.NText).Value = System.Text.Encoding.Unicode.GetString(strmFolderList.ToArray())
cmdAddRequest.Parameters.Add("@insert_list", OdbcType.NText).Value = System.Text.Encoding.Unicode.GetString(strmInsertList.ToArray())