C # code database connection Configuration Interface __ Database
Source: Internet
Author: User
Used to do WinForm program, incredibly special to do an interface to configure the connection string. Today accidentally discovered: unexpectedly can call the configuration interface in the vs.net2005 directly to handle. The use of methods is also simple: first, add reference C:/Program Files/microsoft Visual Studio 8/common7/ide/microsoft.data.connectionui.dialog.dll II, Introducing the namespace C # code using Microsoft.Data.ConnectionUI; C # code Dataconnectiondialog DLG = new Dataconnectiondialog (); Dlg. Datasources.add (Datasource.sqldatasource); Dlg. Selecteddataprovider = Dataprovider.sqldataprovider; Dataconnectiondialog.show (DLG, this); For example, in the Click event of a button, C # code private void Button1_Click (object sender, EventArgs e) {Dataconnectiondialog dlg = new Datacon Nectiondialog (); Dlg. Datasources.add (Datasource.sqldatasource); Dlg. Selecteddataprovider = Dataprovider.sqldataprovider; Dataconnectiondialog.show (DLG, this); Four, the operation of the interface out, is not quite professional! Dataconnectiondialog also has many properties that can be configured to change the appearance of the window to meet different needs.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service