April 29, 2009 at 4:35 am
Public Sub Main()
sqlconn = New SqlConnection("data source=ss;initial catalog=ss;uid=sa;pwd=sa")
sqlcmdFinal = New SqlCommand("test", sqlconn)
sqlcmdFinal.CommandType = CommandType.StoredProcedure
sqlparam_XML_Record = New SqlParameter("@ReXML", SqlDbType.Xml)
Dim xm As Xml.XmlDocument = New Xml.XmlDocument()
Dim Str As String = Dts.Variables("t").Value.ToString()
xm.LoadXml(Str)
sqlparam_XML_Record.Value = xm.InnerXml
sqlcmdFinal.Parameters.Add(sqlparam_XML_Record)
'sqlparam_XML_Record.Value = Dts.Variables("t").Value
sqlconn.Open()
sqlcmdFinal.ExecuteNonQuery()
sqlconn.Close()
Dts.TaskResult = Dts.Results.Success
End Sub
Str string got xml file (
when i run package i got
ERROR :Failed to convert parameter value from a XmlDocument to a String.
how to resolve ?
April 29, 2009 at 5:04 am
chatwithkrishan (4/29/2009)
Public Sub Main()sqlconn = New SqlConnection("data source=ss;initial catalog=ss;uid=sa;pwd=sa")
sqlcmdFinal = New SqlCommand("test", sqlconn)
sqlcmdFinal.CommandType = CommandType.StoredProcedure
sqlparam_XML_Record = New SqlParameter("@ReXML", SqlDbType.Xml)
Dim xm As Xml.XmlDocument = New Xml.XmlDocument()
Dim Str As String = Dts.Variables("t").Value.ToString()
xm.LoadXml(Str)
sqlparam_XML_Record.Value = xm.InnerXml
sqlcmdFinal.Parameters.Add(sqlparam_XML_Record)
'sqlparam_XML_Record.Value = Dts.Variables("t").Value
sqlconn.Open()
sqlcmdFinal.ExecuteNonQuery()
sqlconn.Close()
Dts.TaskResult = Dts.Results.Success
End Sub
Str string got xml file ( 1)
when i run package i got
ERROR :Failed to convert parameter value from a XmlDocument to a String.
how to resolve ?
Can you debug the script and tell us on which line it fails?
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy