中国IT动力,最新最全的IT技术教程
最新100篇 | 推荐100篇 | 专题100篇 | 排行榜 | 搜索 | 在线API文档 | 网通镜像
首 页 | 程序开发 | 操作系统 | 软件应用 | 图形图象 | 网络应用 | 精文荟萃 | 教育认证 | 硬件维护 | 未整理篇 | 站长教程
ASP JS PHP工程 ASP.NET 网站建设 UML J2EESUN .NET VC VB VFP 网络维护 数据库 DB2 SQL2000 Oracle Mysql
服务器 Win2000 Office C DreamWeaver FireWorks Flash PhotoShop 上网宝典 CorelDraw 协议大全 网络安全 微软认证
硬件维护  CPU  主板  硬盘  内存  显卡  显示器  键盘鼠标  声卡音箱  打印机  机箱电源  BIOS  网卡  C#  Java  Delphi  vs.net2005
  当前位置:> 程序开发 > 编程语言 > .NET > 临时文章
不使用COM组件弹出数据库连接对话框
作者:未知 时间:2005-07-27 21:31 出处:CSDN 责编:chinaitpower
              摘要:不使用COM组件弹出数据库连接对话框
今天查SQL Server帮助文件时,刚好点击到Using the OLE DB Connection Dialog Box页面。

Using the OLE DB Connection Dialog Box

OLE DB specifies that each provider must provide a dialog box for defining connections to its data sources. Microsoft® SQL Server™ 2000 Analysis Services complies with this requirement by providing a dialog box that enables the client application to connect to an Analysis server or a local cube.

To use this prompt, the Prompt property of the connection string must be set to 1:

Dim Conn As New ADODB.Connection
Conn.Open "Provider=msolap; Prompt=1;"


呵呵,顺手到.Net下来试试,发现在OleDb下可以使用,

OleDbConnection cn = new OleDbConnection( "Provider=SQLOLEDB.1; Prompt=1" );
弹出

将Provider改为Microsoft.Jet.OLEDB.4.0后,显示这样的



呵呵,其他的Provider就没试了。

SQLConnection下面就不可以使用这种方法。
这个方法有两个不好的地方:
1. 弹出的对话框是非模态的;
2. 只要点击取消就会抛出异常;




关闭本页
 
首页 | 投资与合作 | 服务条款 | 隐私政策 | 收藏本站 | 设为首页 | 新用户注册 | 免责声明 | 使用帮助
Copyright ©2005-2008 chinaitpower.com All rights reserved. www.chinaitpower.com 版权所有