新客网WWW.XKER.COM:致力做中国最专业的网络学院!
学院: 操作系统 - 网络应用 - 服务器 - 网络安全 - 工具软件 - 办公软件 - Web开发 - 数据库 - 网页设计 - 图形图像 - 媒体动画 - 硬件学堂 - 存储频道 - QQ专区
您的位置:首页 > 软件开发 > .Net开发 > Asp.net教程 > 正文:不使用COM组件弹出数据库连接对话框

不使用COM组件弹出数据库连接对话框

新客网 XKER.COM 2005-01-18 来源: 收藏本文
今天查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. 只要点击取消就会抛出异常;
收藏】 【评论】 【推荐】 【投稿】 【打印】 【关闭
发表评论
要记得去论坛讨论,点击注册新会员匿名评论
评论内容:不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
阅读排行
随机推荐
实用信息推荐