In message <E24C985B-49C0-4199-99C3-19DFA5E608F4 (AT) microsoft (DOT) com>, alaspin
<anonymous (AT) discussions (DOT) microsoft.com> writes
Quote:
I am trying to build a VB.NET Application that will create DTS packages
including custom tasks etc..
I have previously done this in VB6.0 and it worked fine but am having
trouble converting my old code to .NET.
'some VB.NET code...
Imports DTS
Imports DTSCustTasks
Imports DTSPump
'some DTS stuff... |
Dim oConnection As DTS.Connection2
oConnection = goPackage.Connections.New("SQLOLEDB")
oConnection.ConnectionProperties("Persist Security Info") = True
'end of code snippet
The DTS code would work in VB6.0 - I know I've seen it
What I get in the Visual Studio .NET IDE is blue wavy lines under the
"oConnection.ConnectionProperties" bit and the compile error:
"Interface 'DTS.OleDBProperties' cannot be indexed because it has no
default property."
..Net does not really do default properties, and as the error says it
needs a property to set for the OleDBPropertie object underpinning the
OleDBProperties collection.
Haven't got a machine to test here, but try-
oConnection.ConnectionProperties("Persist Security Info").Value = True
Converting a DTS Package from Visual Basic 6.0 to Visual Basic .Net
(http://www.sqldts.com/default.aspx?264)
--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com
PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org