on 10-05-2007 2:06 PM
Hi All,
When i trying to load a form thru the folowing code i am getting the error . The error message is
<b>"Object Reference not set to an instance of an object" </b>
Private Sub LoadFromXML(ByRef FileName As String)
Try
Dim oXmlDoc As Xml.XmlDocument
oXmlDoc = New Xml.XmlDocument
'// load the content of the XML File
Dim sPath As String
sPath = IO.Directory.GetParent(Application.StartupPath).ToString
oXmlDoc.Load(sPath & "\Forms\" & FileName)
'// load the form to the SBO application in one batch
SBO_Application.LoadBatchActions(oXmlDoc.InnerXml)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
So what can i do on this?
Pl somebody can help me on this to solve
Regards
Suresh R
hi suresh,
In statement
SBO_Application.LoadBatchActions(oXmlDoc.InnerXml)
u have pass the oXmlDoc.InnerXml. this is wrong with ur code. u have to pass the reference of xml string.
oXmlDoc.Load( sPath + "
" + FileName );
// load the form to the SBO application in one batch
string sXML = oXmlDoc.InnerXml.ToString();
SBO_Application.LoadBatchActions(ref sXML);
hope this will help u.
if satisfied, rewards points
regards
nirdesh panwar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hai Suresh
I think u trying to load the xml file so,
Try this,
Sub AddXML(ByVal pathstr As String)
Try
Dim xmldoc As New MSXML2.DOMDocument
Dim stream As System.IO.Stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("<ProjectName>." + pathstr)
Dim streamreader As New System.IO.StreamReader(stream, True)
xmldoc.loadXML(streamreader.ReadToEnd())
streamreader.Close()
app.LoadBatchActions(xmldoc.xml)
Catch ex As Exception
'app.MessageBox(ex.Message)
End Try
End Sub
Regards,
Anitha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Suresh,
Have a look at the sample code that is part of the Business One SDK and see if your code is similar.
..\Program Files\SAP\SAP Business One SDK\Samples\COM UI\VB.NET\04.WorkingWithXML
Eddy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
7 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.