The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages - More
> .Net Development
|
VB.Net COM+ Implementation
Discuss VB.Net COM+ Implementation in the .Net Development forum on Dev Shed. VB.Net COM+ Implementation .NET development forum discussing all .NET derivatives including C#, VB.NET, ASP.NET, ADO.NET and more. Learn the ins and outs of using the .NET framework.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

August 27th, 2003, 09:49 AM
|
|
Contributing User
|
|
Join Date: Jul 2003
Posts: 57
Time spent in forums: < 1 sec
Reputation Power: 10
|
|
|
VB.Net COM+ Implementation
Hi,
I developed a VB.Net Class Library project which uses Imports System.EnterpriseServices and inherits ServicedComponent.
The class has a subroutine DoSomething()
The code is given below. I have another console application which instantiates this object and then calls the DoSomething method. The issue is that after the code after the following line does not get executed for some reason and the control goes back to the calling application.
' Code does not execute after this line. The value of oNumHits is 4.
For Increment = 0 To Convert.ToInt32(oNumHits) - 1
Does anybody have any clues??
Public Sub DoSomething()
Dim AreaAttributes As String() = New String() {"AREA", "DOC_PC_CRM_IMAGE", "TEXT_0001", _
"POS_NR", "SUBAREAS_EXIST"}
Dim CategoryId As String = "3F2F48DEFA5B1ACAE1000000CD8620C6"
Dim DSProductArea As New DataSet()
Dim DTProductArea As New DataTable()
For Increment = 0 To AreaAttributes.Length - 1
Dim DOCATTRTAB As New CRMIntegration.SRETATR2()
DOCATTRTAB.Attrname = AreaAttributes(Increment)
Me.tretatR2Table1.Add(DOCATTRTAB)
DOCATTRTAB = Nothing
Next
Dim QueryParameters As String(,) = New String(2, 5) {{"00001", "AREA", "ZCAT01", "", "EQ", "A"}, _
{"00002", "PARENT_AREA", "ZCAT01", "", "EQ", "A"}, _
{"00003", "", "OR", "", "EQ", "O"}}
For Increment = 0 To 2
Dim QUERYTAB As New CRMIntegration.SRETQYSE()
QUERYTAB.Secount = QueryParameters(Increment, 0)
QUERYTAB.Location = QueryParameters(Increment, 1)
QUERYTAB.Value1 = QueryParameters(Increment, 2)
QUERYTAB.Value2 = QueryParameters(Increment, 3)
QUERYTAB.Operator = QueryParameters(Increment, 4)
QUERYTAB.Rowtype = QueryParameters(Increment, 5)
Me.tretqyseTable1.Add(QUERYTAB)
QUERYTAB = Nothing
Next
' The connection to the SAP system will be made using the SAP Connector. To save time for making
' a new connection for each request the SAPConnectionPool will be used to get the connection from
' the pool.
Try
oNumHits = ""
oRCodeRet = ""
SAPProxy.Connection = SAP.Connector.SAPConnectionPool.GetConnection(SAPConnectionString)
SAPProxy.Connection.Open()
SAPProxy.Sret_Documents_Search("", CategoryId, "", oNumHits, oRCodeRet, Me.tretatR2Table1, Me.tretlaN2Table1, _
Me.tretqatR1Table1, Me.tretqyseTable1, Me.tretdcatvlTable1, Me.tretresdocTable1, _
Me.tretteratrTable1)
SAP.Connector.SAPConnectionPool.ReturnConnection(SAPProxy.Connection)
Catch ex As Exception
Console.WriteLine(ex.ToString)
End Try
For Increment = 0 To AreaAttributes.Length - 1
Dim AttributeCol As New DataColumn()
AttributeCol.DataType = System.Type.GetType("System.String")
AttributeCol.ColumnName = AreaAttributes(Increment)
DTProductArea.Columns.Add(AttributeCol)
AttributeCol = Nothing
Next
Dim RowIncrement As Integer = 0
Dim MyArray As String(,) = New String(Convert.ToInt32(oNumHits) - 1, AreaAttributes.Length - 1) {}
' Code does not execute after this line. The value of oNumHits is 4.
For Increment = 0 To Convert.ToInt32(oNumHits) - 1
Dim AttributeRow As DataRow = DTProductArea.NewRow
Dim IsNextHitCounter As Integer = 0
Dim TextDescription As String = ""
While IsNextHitCounter < 2
If RowIncrement < tretdcatvlTable1.Count Then
If (tretdcatvlTable1(RowIncrement).Attrname.ToString() = "AREA") Then
IsNextHitCounter += 1
If (IsNextHitCounter <> 2) Then
MyArray(Increment, 0) = tretdcatvlTable1(RowIncrement).Value1.ToString()
RowIncrement += 1
Else
Exit While
End If
End If
Else
Exit While
End If
If RowIncrement < tretdcatvlTable1.Count Then
If (tretdcatvlTable1(RowIncrement).Attrname.ToString() = "DOC_PC_CRM_IMAGE") Then
MyArray(Increment, 1) = tretdcatvlTable1(RowIncrement).Value1.ToString()
RowIncrement += 1
Else
Exit While
End If
End If
If RowIncrement < tretdcatvlTable1.Count Then
If (tretdcatvlTable1(RowIncrement).Attrname.ToString() = "TEXT_0001") Then
TextDescription += tretdcatvlTable1(RowIncrement).Value1.ToString()
RowIncrement += 1
Else
Exit While
End If
End If
If RowIncrement < tretdcatvlTable1.Count Then
If (tretdcatvlTable1(RowIncrement).Attrname.ToString() = "POS_NR") Then
MyArray(Increment, 3) = tretdcatvlTable1(RowIncrement).Value1.ToString()
RowIncrement += 1
Else
Exit While
End If
End If
If RowIncrement < tretdcatvlTable1.Count Then
If (tretdcatvlTable1(RowIncrement).Attrname.ToString() = "SUBAREAS_EXIST") Then
MyArray(Increment, 4) = tretdcatvlTable1(RowIncrement).Value1.ToString()
RowIncrement += 1
Else
Exit While
End If
End If
End While
MyArray(Increment, 2) = TextDescription
Next
End Sub
Here is the calling code:
Dim D As New ProductCatalog.AreaDetails()
D.DoSomething()
' To return the object to the object pool, use DisposeObject.
' This allows the object to be reused from the pool. If you do not call
' DisposeObject, the garbage collector does not collect this object,
' and the object is not reused from the object pool.
ServicedComponent.DisposeObject(D)
Thanks,
__________________
Ranjan Kumar
|

August 27th, 2003, 12:11 PM
|
|
Contributing User
|
|
Join Date: Jul 2003
Posts: 57
Time spent in forums: < 1 sec
Reputation Power: 10
|
|
|
Solved
Issue Solved....
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|