JamesBrian
asked on
Client / Server question
HI all,
I'm fairly new at this, so bear with me if I am not coming across correctly.
I have an existing client/server applictaion.
On client side, I am selecting records from a datagrid.
The gridline(s) that are selected, are processed, and some columns end up in a custom type: GridLineItems
This class resides on the Client side (is this correct?)
This type has some properties :
- FileLine as string
- FileNaam as string
- VerstuurCode as string
and so on
I use an arraylist to store my GridLineItems.
'declarations :
Dim arrline As GridLineItems
Lines = New ArrayList
' Button Event:
For x = 0 To nbrRows - 1
currID = Convert.ToString(grdSendFr omFile.Ite m(tel, 0))
Dim newID As String = Format_ID(currID)
Dim soort As String = Convert.ToString(grdSendFr omFile.Ite m(tel, 6))
Dim verstuurCode As String = Convert.ToString(grdSendFr omFile.Ite m(tel, 8))
Dim verzendDatum As String = Convert.ToString(grdSendFr omFile.Ite m(tel, 10))
arrline = New GridLineItems
arrline.FileLine = PrePareLine(newID, soort, verstuurCode)
arrline.FileNaam = newID
arrline.VerstuurCode = verstuurCode
arrline.VerzendDatum = verzendDatum
arrline.Soort = soort
Lines.Add(arrline)
Next
So far, so good.I now have an arraylist of GridLineItems objects.
The (for me) tricky part is to 'send' my ArrayList (Lines) to the serverside.
CallToServer = ApplicationContext.WsDMFAT ool.testme (Lines)
-------SERVER SIDE-------
Public Function testme(ByVal arr As ArrayList) As Boolean
Dim returnValue As Boolean = Nothing
Dim arrline As GridLineItems
Dim tw As StreamWriter
Try
For Each arrline In Lines
currID =
tw.WriteLine(arrline.FileL ine) ' create textfile
Next
Return True
Catch ex As Exception
End Try
End Function
-------------------------- -
But of course, the type GridLineItems is unknown on Server Side
How do I get this to work?
Am I doing something fundamentally wrong?
Am I not declaring something I should?
Any help is appreciated.
I'm fairly new at this, so bear with me if I am not coming across correctly.
I have an existing client/server applictaion.
On client side, I am selecting records from a datagrid.
The gridline(s) that are selected, are processed, and some columns end up in a custom type: GridLineItems
This class resides on the Client side (is this correct?)
This type has some properties :
- FileLine as string
- FileNaam as string
- VerstuurCode as string
and so on
I use an arraylist to store my GridLineItems.
'declarations :
Dim arrline As GridLineItems
Lines = New ArrayList
' Button Event:
For x = 0 To nbrRows - 1
currID = Convert.ToString(grdSendFr
Dim newID As String = Format_ID(currID)
Dim soort As String = Convert.ToString(grdSendFr
Dim verstuurCode As String = Convert.ToString(grdSendFr
Dim verzendDatum As String = Convert.ToString(grdSendFr
arrline = New GridLineItems
arrline.FileLine = PrePareLine(newID, soort, verstuurCode)
arrline.FileNaam = newID
arrline.VerstuurCode = verstuurCode
arrline.VerzendDatum = verzendDatum
arrline.Soort = soort
Lines.Add(arrline)
Next
So far, so good.I now have an arraylist of GridLineItems objects.
The (for me) tricky part is to 'send' my ArrayList (Lines) to the serverside.
CallToServer = ApplicationContext.WsDMFAT
-------SERVER SIDE-------
Public Function testme(ByVal arr As ArrayList) As Boolean
Dim returnValue As Boolean = Nothing
Dim arrline As GridLineItems
Dim tw As StreamWriter
Try
For Each arrline In Lines
currID =
tw.WriteLine(arrline.FileL
Next
Return True
Catch ex As Exception
End Try
End Function
--------------------------
But of course, the type GridLineItems is unknown on Server Side
How do I get this to work?
Am I doing something fundamentally wrong?
Am I not declaring something I should?
Any help is appreciated.
ASKER
\Implementation\Server\Lin eItems.vb( 1): class 'GridLineItems' and class 'GridLineItems', declared in \Client\LineItems.vb', conflict in namespace '<Default>'.
ASKER
I had tried that, but I get a warning :
\Implementation\Server\Lin eItems.vb( 1): class 'GridLineItems' and class 'GridLineItems', declared in \Client\LineItems.vb', conflict in namespace '<Default>'.
\Implementation\Server\Lin
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The custom type: GridLineItems that is defined on the client side must be declared on the server side as well, the same exact way, otherwise the server does not know what is being passed to it.
Fernando