on 07-06-2005 3:06 PM
Hi.
I am using NCo ver 2.0.1.
I am developing a VB.NET application.
I create a ConfigDestination object, by reading connection parameters from the <i>.config</i> file.
After that (in debug mode) i check the <b>ConfigDestination.ConnectionString</b> property and I verify it is correct.
So I create a <b>SAPConnection</b>, using the overloaded constructor accepting a IDestination object.
fter that (in debug mode) i check the <b>SAPConnection.ConnectionString</b> but it is an empty string.
Here's the code (VB)
'get Destination from configuration file 'app'.config
_SapConfigDestination = New SAP.Connector.ConfigDestination("testSectionName")
'creates a connection object
SapConnection = New SAP.Connector.SAPConnection(SapConfigDestination)
Logger.Write(CObj("Connection created"), ctCategory, 0, 0, Severity.Information)
'instantiate proxy object
Proxy = New SAPProxy(SapConnection.ConnectionString)
Thank you very much, this solves the problem.
Still I can't' understand the reason why the connection string is not embedded transmitted from the Destination object to the SAPConnection object and to the SapProxy object.
These classes have the ConnectionString property which returns an empty string after these passages.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
> Thank you very much, this solves the problem.
What's about assigning some reward points?
> Still I can't' understand the reason why the
> connection string is not embedded transmitted from
> the Destination object to the SAPConnection object
> and to the SapProxy object.
>
> These classes have the ConnectionString property
> which returns an empty string after these passages.
I can't also really understand what happens here. The SAPConnection's ConnectionString property is only reset (intentionally) to empty string, when the connection is closed. I don't see when this happens in your code, maybe somehow through the GC.
Anyway, your original code didn't make so much sense, because you in fact would create two SAPConnections: One explictly and another one implicitly by passing a connection string to the constructor of your proxy. Only the second one would then be used anyway. Note that the SAPConnection is really the active connection - the thing that has the socket open.
_SapConfigDestination = New SAP.Connector.ConfigDestination("testSectionName")
Now either:
SapConnection = New SAP.Connector.SAPConnection(SapConfigDestination)
_Proxy = New SAPProxy()
_Proxy.Connection = _SapConnection
Or:
Proxy = New SAPProxy(SapConfigDestination.ConnectionString)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.