.Net Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - More.Net Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 27th, 2003, 09:49 AM
ranjankumar17 ranjankumar17 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 57 ranjankumar17 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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

Reply With Quote
  #2  
Old August 27th, 2003, 12:12 PM
ranjankumar17 ranjankumar17 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 57 ranjankumar17 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 10
Issue Solved

Issue Solved

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - More.Net Development > VB.Net COM+ Implementation

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap