DotNet数据库连接窗口的调用

      引用D:/Program Files/Microsoft Visual Studio 9.0/Common7/IDE下面的:

      Microsoft.Data.ConnectionUI.dll

      Microsoft.Data.ConnectionUI.Dialog.dll

      命名空间引用:

      using Microsoft.Data.ConnectionUI;

 

 

 

private void tsmisDataSet_Click(object sender, EventArgs e) { Microsoft.Data.ConnectionUI.DataConnectionDialog dlg = new Microsoft.Data.ConnectionUI.DataConnectionDialog(); DataSource.AddStandardDataSources(dlg); if (DataConnectionDialog.Show(dlg) == System.Windows.Forms.DialogResult.OK) { MessageBox.Show(string.Format("{0}/r{1}", dlg.ConnectionString, dlg.SelectedDataProvider.DisplayName)); } }  

 

你可能感兴趣的:(开发技术-Net,数据库,object)