473,396 Members | 1,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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.
Feb 21 '06 #1
2 2169
clng(TextBox1.Text) should do
"XML newbie: Urgent pls help!"
<XM********************@discussions.microsoft.co m> wrote in message
news:92**********************************@microsof t.com...
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.

Feb 21 '06 #2
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:
clng(TextBox1.Text) should do
"XML newbie: Urgent pls help!"
<XM********************@discussions.microsoft.co m> wrote in message
news:92**********************************@microsof t.com...
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.


Feb 22 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: The Plankmeister | last post by:
Hi (again) I'm purposely generating an SQL error to test my aforementioned custom error handling function, but I encounter a strange problem. The error string generated by my forced error is: ...
1
by: toufik toufik | last post by:
I'm using the errorHandler function (http://www.zend.com/zend/spotlight/error.php) to manage error handling in my code, the problem is that in all the tests that I did the error type is always...
1
by: Elie B. | last post by:
Hi, I'm new to Python. I'm trying to embbed Python in my Windows application having some success with redirecting the stdin/out to my windows application using: In my C++ code I use...
2
by: Iona | last post by:
Does anyone know this type of error means? Error Type: Microsoft OLE DB Provider for ODBC Drivers (0x80004005) Could not use ''(unknown)''; file already in use. /asp/PPLMain/memberpage.asp, line...
1
by: Iona | last post by:
Thanks for the reply it helped me but then I get this Error Type: Provider (0x80004005) Unspecified error /asp/PPLMain/memberpage.asp, line 10 and my line 10 is still ...
1
by: Chuck | last post by:
Hi! I have a ASP page that generates an excel report. It works fine if there are records found, however, if no records are found I would like to call the below listed function instead of getting...
1
by: Mr. x | last post by:
Hello, If I did : try ... do something catch ... do something end try ....
2
by: Kevin G. | last post by:
I am trying to instantiate an in-house DLL within my ASP application and I'm getting the following error: Error Type: Server object, ASP 0177 (0x800AEA5F) 800aea5f I have tried...
9
by: fscked | last post by:
Anyone have an idea of what I might do to fix this? I have googled adn can only find some random conversations about it that doesn't make sense to me. I am basically reading in a csv file to...
1
by: sandeepthachan | last post by:
We have created one web site. Here if one person loggined and try to access a particular page then it goes to the error page with the message that the page cannot be dispalyed. and also it displays...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.