解决方案 »
- 'CREATE VIEW' 必须是查询批次中的第一个语句。
- tableLayoutPanel1运行闪烁
- 如何镜像打印二代证临时身份证底卡
- 我所在的城市软件公司不多,但我发现那几个公司总是隔三差五的招聘,为什么?真的没有这方面的人才吗?还是用了2,3个月不用了,再找新人
- 有什么方法,交换一个dataview里的两列数据(包括列名)。。。急,都问了好几次了。。谢谢。。
- c#语言是否是纯粹的面向对象语言
- 一个简单的正则表达式问题
- 求教viewstate和session及COOKIE的本质区别,在线立结,急
- 免费国际一级域名+100M支持ASP、CGI空间快申请呀,申请成功每位加20分
- 上面的大虾,c#有没有拷贝构造函数,有的话可以自己定义吗?
- 关于C#的代码问题
- 我用格式“F4”,结果数据“12.5120”在DataGridView单元格中显示为“12.512”,最后一位0被省掉了,如何保留最后一位0
参考:
http://erikej.blogspot.com.au/2010/04/using-adonet-data-connection-dialog-in.html
http://www.codeproject.com/Articles/181395/How-to-create-custom-dialog-boxes-using-the-Web-Se
Using the ADO.NET Data Connection dialog in your own application – and limiting the choice of data sources
In version 3.0 of the ExportSqlCE SSMS add-in, I have used the newly released Visual Studio ADO.NET Add Data Connection dialog to prompt the user for connection information to the server. This dialog is now available in source code here.This project consists of this well-know dialog (and others) – used in the Visual Studio Server Explorer:
For the purpose of the add-in, I was interested in on the Microsoft SQL Server data source, as this was the target of the scripting code.This was achieved in the following way:
using Microsoft.Data.ConnectionUI;
…
DataSource sqlDataSource = new DataSource("MicrosoftSqlServer", "Microsoft SQL Server");
sqlDataSource.Providers.Add(DataProvider.SqlDataProvider);
DataConnectionDialog dcd = new DataConnectionDialog();
dcd.DataSources.Add(sqlDataSource);
dcd.SelectedDataProvider = DataProvider.SqlDataProvider;
dcd.SelectedDataSource = sqlDataSource;
if (DataConnectionDialog.Show(dcd) == DialogResult.OK)
{
string connectionString = dcd.ConnectionString;
The result is the following dialog, notice that the Change… button is disabled:
There are a few limitations though, which are listed below:You have no access whatsoever over the controls in the dialog box; for example, you would want to have a Form where the user checks the “Windows Authentication” option and you would want to hide the username and password fields provided for SQL Server authentication. This cannot be achieved using the predefined dialog boxes.
我知道可以这样子,但是这样不就是分两次执行代码了吗?怎么在页面之间插入事件?
form是用的windows form application 项目写的,然后再用install 类调用显示。最后类库再输出到web安装程序。
如何获取到.sql的脚本路径?