Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old February 21st, 2006, 03:05 PM
XML newbie: Urgent pls help!
Guest
 
Posts: n/a
Default Error:Value of type 'String' cant be converted to 1-dim array of L

Hi,

I am getting the error: Value of type 'String' cannot be converted to
'1-dimensional array of Long'.

in the following line for TextBox2.Text field :

doc.LoadXml(EDP.ExportPositions(TextBox1.Text,
cmbStartDateandTime.SelectedText,
cmbEndDateandTime.SelectedText, TextBox2.Text)))

Actually, I have a webReference to ExportData.asmx file. Here, Assets
column has datatype as Long. Since the textbox I
created for Assets label has datatype string, this
is causing the problem.

I tried all conversion types but it doesn't work. I appreciate your quick
help and thanku in advance.
  #2  
Old February 21st, 2006, 05:55 PM
Onawole, Clement Oladapo
Guest
 
Posts: n/a
Default Re: Error:Value of type 'String' cant be converted to 1-dim array of L

clng(TextBox1.Text) should do


"XML newbie: Urgent pls help!"
<XMLnewbieUrgentplshelp@discussions.microsoft.co m> wrote in message
news:922A88B1-CD62-42D2-9768-A38EF40D4933@microsoft.com...[color=blue]
> Hi,
>
> I am getting the error: Value of type 'String' cannot be converted to
> '1-dimensional array of Long'.
>
> in the following line for TextBox2.Text field :
>
> doc.LoadXml(EDP.ExportPositions(TextBox1.Text,
> cmbStartDateandTime.SelectedText,
> cmbEndDateandTime.SelectedText, TextBox2.Text)))
>
> Actually, I have a webReference to ExportData.asmx file. Here, Assets
> column has datatype as Long. Since the textbox I
> created for Assets label has datatype string, this
> is causing the problem.
>
> I tried all conversion types but it doesn't work. I appreciate your quick
> help and thanku in advance.[/color]


  #3  
Old February 22nd, 2006, 07:35 PM
XML newbie: Urgent pls help!
Guest
 
Posts: n/a
Default Re: Error:Value of type 'String' cant be converted to 1-dim array

I already tried this. but, it didn't work. Actually, Assets column is stored
as 1 dimensional array of Long in the database.

I wrote a function to do this:


Public Sub StringToArray(ByVal sThisString As String, ByVal asResults() As
Long, Optional ByVal sDelimRows As String = "ae", Optional ByVal sDelimCols
As String = "[]")

Dim lPos1dDel As Long, lLenString As Long, lColSepLen As Long
Dim lLastPos As Long, lThisRow As Long, lNumCols As Long, lThisCol
As Long, lRowSepLen As Long
lLenString = Len(sThisString)
If lLenString Then


lLastPos = 1
lPos1dDel = InStr(1, sThisString, sDelimRows)

'Dim StringCount As Integer 'The number of strings to output
'lNumCols = StringCount(sThisString, vbTextCompare)
lRowSepLen = Len(sDelimRows)

'If Not lNumCols Then
'Convert a 1D string
'Create buffer to store results
ReDim asResults(0 To Int(lLenString - 1 / 2))
lPos1dDel = InStr(lLastPos, sThisString)
Do While lPos1dDel
lThisRow = lThisRow + 1
asResults(lThisRow) = Mid$(sThisString, lLastPos, lPos1dDel
- lLastPos)
lLastPos = lPos1dDel
lPos1dDel = InStr(lLastPos, sThisString)

Loop
ReDim Preserve asResults(0 To lThisRow)


When I call asResults() in the following line, I get the error: Number of
indices is less than the number of dimensions of the indexed array

doc.LoadXml(EDP.ExportPositions(TextBox1.Text,
cmbStartDateandTime.SelectedText, cmbEndDateandTime.SelectedText,
asResults()))

"Onawole, Clement Oladapo" wrote:
[color=blue]
> clng(TextBox1.Text) should do
>
>
> "XML newbie: Urgent pls help!"
> <XMLnewbieUrgentplshelp@discussions.microsoft.co m> wrote in message
> news:922A88B1-CD62-42D2-9768-A38EF40D4933@microsoft.com...[color=green]
> > Hi,
> >
> > I am getting the error: Value of type 'String' cannot be converted to
> > '1-dimensional array of Long'.
> >
> > in the following line for TextBox2.Text field :
> >
> > doc.LoadXml(EDP.ExportPositions(TextBox1.Text,
> > cmbStartDateandTime.SelectedText,
> > cmbEndDateandTime.SelectedText, TextBox2.Text)))
> >
> > Actually, I have a webReference to ExportData.asmx file. Here, Assets
> > column has datatype as Long. Since the textbox I
> > created for Assets label has datatype string, this
> > is causing the problem.
> >
> > I tried all conversion types but it doesn't work. I appreciate your quick
> > help and thanku in advance.[/color]
>
>
>[/color]
 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles