If you need to customize a dialog box that allows you to set data link properties, consider using the system's own Data Link Properties dialog box first.
The invocation is simple, with the introduction of Adodb.dll and Oledb32.dll in the project, which is a. NET library, and the latter is a COM library (Microsoft OLE DB Service Component 1.0 Type Library). Use the following code again:
ADODB. Connection adodbconnection = new ADODB. Connection ();
Object connection = (object) adodbconnection;
MSDASC. DataLinks dlg = new MSDASC. DataLinks ();
Dlg. Promptedit (ref connection);
The system's own Data Link Properties dialog box can be opened. Common data Link properties can be set here, and finally by the incoming "connection" parameter, "Adodbconnection", you can get the desired connectionstring properties and use them in subsequent programs.
This column more highlights: http://www.bianceng.cnhttp://www.bianceng.cn/Programming/net/