473,463 Members | 1,532 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

VB.Net: Accessing the database on the remote server thru Web Servi

I want to query the database located on the remote server(not on my network)
based on the time frame and tables selected by the user in the GUI.I have
created a reference to it's webservices. The results should be displayed on
the browser in a My first question, how should I do this.

In the webservice, the function is defined as:

Public Function ExportPositions(ByVal SessionID As String, ByVal
StartDateTime As Date, ByVal EndDateTime As Date,
<System.Xml.Serialization.XmlArrayItemAttribute("A ssetID",
IsNullable:=false)> ByVal AssetList() As Long) As Position()
Dim results() As Object = Me.Invoke("ExportPositions", New
Object() {SessionID, StartDateTime, EndDateTime, AssetList})
Return CType(results(0),Position())
End Function

Secondly, for testing purpose I did the following.Now, sinceTextbox2.Text
refers to the column AssetList in the table and there it is stored as an
Array of Long. Now, when I do
the following, I get an error stating strring cannot be converted to
arraytype long.

doc.LoadXml(EDP.ExportPositions(TextBox1.Text,
cmbStartDateandTime.SelectedText, cmbEndDateandTime.SelectedText,
Textbox2.Text))
If I take out (Textbox2.Text) from the above line , I get the message,
Argument not specified for the parameter AssetList.
I got this function from the net that converts string to an array:

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

sThisString = strAsset.Text

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, sDelimCols,
CompareMethod.Text)

lRowSepLen = Len(sDelimRows)

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

Loop
ReDim Preserve asResults(0 To (lThisRow - 1))

'End If
'Else
'Erase asResults

End If

End Sub

This one also doesn't work.
Feb 24 '06 #1
0 1183

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

Similar topics

4
by: Jaydeep | last post by:
Hello, I am facing a strange problem. Problem accessing remote database from ASP using COM+ server application having VB components (ActiveX DLL) installed. Tier 1 : ASP front End (IIS 5.0) Tire...
2
by: Douglas Harber | last post by:
If I have DB2 8.1 (FP5, I believe, but not relevant to my question...I hope) installed on my desktop, do I have what I need to connect to a remote DB2 server (also running 8.1 FP5) from my desktop...
1
by: NagaKiran | last post by:
Hi I need a help. I have a VB code In that I want to connect to a remote database thru VB code. Can we connect a Access database which is located in a web server thru VB? If so how can we...
7
by: David Laub | last post by:
I've also posted this issue to a Sun/java formum, but since it appears to be an integration issue, this may be the better place to posr: I have written a dot net/c# Web Services doesn't fully...
0
by: John Fleming | last post by:
Hello, I am building a web application with the following components: 2 Web Servers - Windows Server 2003 - IIS 6 - .Net Framework version 2.0 - Reside in Domain A 2 Clustered Database...
0
by: XML newbie: Urgent pls help! | last post by:
I want to query the database located on the remote server(not on my network) based on the time frame and tables selected by the user in the GUI.I have created a reference to it's webservices. The...
3
by: Pakna | last post by:
Hello, I have what may be a beginner's question regarding DB2. How does one access a remote table on a remote database via SQL? What is the command string, is there an equivalent of Oracle...
5
by: Mike | last post by:
I'm having trouble accessing SQL2005 Standard Edition as a second instance of SQL Server where the first instance is SQL 2000 Enterprise Edition. I installed SQL 2005 as a named instance...
0
by: shamirza | last post by:
ADO.Net Making the Connection: Accessing Your Database using ADO.NET Data Access Namespaces Within the .NET framework class library (FCL) version 1.1, there are five third-level namespaces that...
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...
1
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.