kiwi
Member
- Joined
- Jul 12, 2006
- Messages
- 14
- Programming Experience
- Beginner
Hy! I'm sorry if i can't explain my problem very well, i'm italian but i need help for a problem with vb.net program... so...
I made a web service that extract some value from a db and this result must be insered in this public structure:
and then I wrote:
Return SERVS1Result (the name of my public structure)
what is the problem?
the problem is that I have many result from my db and for this I need to create a Array of my Public Structure
I try to create it but i receive some messagge error!!
I post my code and i hope that you can help me, I try to ask help in many forum but nobody say me nothing PLEASE!!!
thank you
I made a web service that extract some value from a db and this result must be insered in this public structure:
VB.NET:
Public Structure SERVS1Result
Public NumeroComm As Integer
Public Comm As SComm
Public Structure SComm
Public Nome As String
Public Indirizzo As String
Public Cap As String
Public Comune As String
Public SiglaProvincia As String
Public Email As String
Public telefono As String
End Structure
End Structure
Return SERVS1Result (the name of my public structure)
what is the problem?
the problem is that I have many result from my db and for this I need to create a Array of my Public Structure
I try to create it but i receive some messagge error!!
I post my code and i hope that you can help me, I try to ask help in many forum but nobody say me nothing PLEASE!!!
VB.NET:
<Start of function>
Public Com() As Object '<----------------------------------------///
[.....code....]
If Not risolvi = "" Then
objConn.Open()
Dim pc As String
Dim i As Integer = 0
Dim x As Integer = 0
Dim c As Integer
Dim objCmd2 As New OleDbCommand("Stringa di connessione", objConn)
Dim objReader2 As OleDbDataReader
objReader2 = objCmd2.ExecuteReader
While objReader2.Read
pc = (objReader2.GetString(9))
If pc = "Y" Then
i = i + 1
Com(i) = New SERVS1Result '<-----------------------------------///
Com(i).Comm.Nome = objReader2.GetString(2) 'Sede
Com(i).Comm.Indirizzo = objReader2.GetString(4) 'indirizzo
Com(i).Comm.telefono = objReader2.GetString(5) 'telefono
Com(i).Comm.Email = objReader2.GetString(8) 'email
Com(i).Comm.Cap = CapCom
Com(i).Comm.Comune = Comune
Com(i).Comm.SiglaProvincia = Provincia
End If
End While
objConn.Close()
objConn.Dispose()
Com(i).NumeroComm = i '<------------------------------------------///
For c = 0 To Com.Length '<-------------------------------///
Return Com(c) '<-----------------------------///
Next
End If
End Function
<End Function>
<Start Public Structure>
Public Structure SERVS1Result
Public NumeroComm As Integer
Public Comm As SComm
Public Structure SComm
Public Nome As String
Public Indirizzo As String
Public Cap As String
Public Comune As String
Public SiglaProvincia As String
Public Email As String
Public telefono As String
End Structure
End Structure
thank you
Last edited by a moderator: