I am working on application that requires downloading data from the remote
databse by creating a refernce to it's web services.In my GUI, I have a
combobox for table name to query and the starttime and end time to get data
for.Let's suppose I want to query positions table, the function for that in
proxy class is mentioned below, where AssetList is an XML node containing a
list of one or more Assets.Assset is an XML node with the attribute of it's
unique id number.AssetID is the unique identification number of the asset.
This is the function
Public Function ExportPositions (ByVal SessionID As String, ByVal
StartDateTime As Date, ByVal EndDateTime As Date,
<System.Xml.Ser ialization.XmlA rrayItemAttribu te("AssetID",
IsNullable:=fal se)> ByVal AssetList() As Long) As Position()
Dim results() As Object = Me.Invoke("Expo rtPositions", New Object()
{SessionID, StartDateTime, EndDateTime, AssetList})
Return CType(results(0 ),Position())
End Function
I am doing this for download button:
Private Sub btdownload_Clic k(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles btdownload.Clic k
'g_SessionID()
'Dim nsmgr As XmlNamespaceMan ager
'nsmgr = New XmlNamespaceMan ager(filterDoc. NameTable)
Dim EDP As ExportData.Expo rtDataWS
EDP = New ExportData.Expo rtDataWS
Dim doc As XmlDocument
doc = New XmlDocument
Dim node As XmlNode
Dim noderead As XmlNodeReader
noderead = New XmlNodeReader(n ode)
'Try
Dim elementnode As String
Dim nodecontents As String
doc.LoadXml(EDP .ExportPosition s(cmbSelectdata .SelectedItem,
cmbStartDateand Time.SelectedTe xt, cmbAsset.Select edIndex))
For Each node In doc
While (noderead.Read( ))
If (noderead.NodeT ype = XmlNodeType.Ele ment) Then
'string elementnode, nodecontents
nodecontents = noderead.ReadSt ring()
If (nodecontents Is Nothing) Then
nodecontents = noderead.Value. ToString()
noderead.ReadOu terXml()
elementnode = noderead.Name
Label2.Text += elementnode + "-" + nodecontents +
"<br>"
End If
End If
End While
Next
My first question is: Can I query the methodGetPositi ons without creating a
combobox for tables? If yes, how.
If no, then I will be using combobox and it's text is in string then how can
I convert it into Long() and put it in the line:
doc.LoadXml(EDP .ExportPosition s(cmbSelectdata .SelectedItem,
cmbStartDateand Time.SelectedTe xt, cmbAsset.Select edIndex))
I thanku all in advance for your time and pls reply asap.It's really urgent...
"XML newbie: Urgent pls help!" wrote:
function to convert string to 1 dimensional array of long in VB.Net