B
Ben Fidge
How do you invoke the Data Link Properties dialog for an
SqlConnection connection string?
I need to be able to allow my users to build connection
strings for Sql Server ADO.NET provider using the Data
Link Properties dialog, like the IDE does when you
select "New Connection..." in the
SqlConnection.ConnectionString drop-down in Properties.
I can invoke it and retrieve an Ole DB connection string,
but need to be able to build ADO.NET connection strings
using the following code.
MSDASC.DataLinksClass oClass = new MSDASC.DataLinksClass
();
object oCon = new ADODB.ConnectionClass();
oClass.PromptEdit(ref oCon);
MessageBox.Show((oCon as
ADODB.ConnectionClass).ConnectionString);
Note: You need to add references to the following COM
libraries:
Microsoft ActiveX Data Objects 2.7 Library
Microsoft OLE DB Service Component 1.0 Type Library
Also, is it possible to force the Provider selection to
Sql Server?
Thanks
Ben Fidge
SqlConnection connection string?
I need to be able to allow my users to build connection
strings for Sql Server ADO.NET provider using the Data
Link Properties dialog, like the IDE does when you
select "New Connection..." in the
SqlConnection.ConnectionString drop-down in Properties.
I can invoke it and retrieve an Ole DB connection string,
but need to be able to build ADO.NET connection strings
using the following code.
MSDASC.DataLinksClass oClass = new MSDASC.DataLinksClass
();
object oCon = new ADODB.ConnectionClass();
oClass.PromptEdit(ref oCon);
MessageBox.Show((oCon as
ADODB.ConnectionClass).ConnectionString);
Note: You need to add references to the following COM
libraries:
Microsoft ActiveX Data Objects 2.7 Library
Microsoft OLE DB Service Component 1.0 Type Library
Also, is it possible to force the Provider selection to
Sql Server?
Thanks
Ben Fidge