smo不提供我的PC上已安装的sql server实例 [英] smo does not gives installed instances of sql servers on my pc

查看:101
本文介绍了smo不提供我的PC上已安装的sql server实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友,我想使用smo在我的电脑上找到sql服务器实例,我已经写了代码

hi friend I want to find sql server instances on my pc by using smo i have writen code

DataTable dataTable = SmoApplication.EnumAvailableSqlServers(false);
string  constr2 = dataTable.Rows[0].ItemArray.GetValue(1).ToString();


但是它没有给出任何实例名称,它表明在0possion处没有数据.我正在使用SQL Server 2008&我也chmo svir virsion 9.0& 10.0我的操作系统是win7,请帮助我.当我输入恶意名称并尝试连接到服务器时,它再次提示错误,无法连接到serter"instanceane"代码,该错误是这样的


but it does not gives any name of instance it showes that there is no datata at 0possion. I am using sql server 2008 & I also chck smo virsion 9.0 & 10.0 my os is win7 please help me.when i put name maully and try to connect to server it again gives error failed to connect to serter "instanceane" code which gives this error is like this

Server server = new Server(new ServerConnection(constr2));
MessageBox.Show(server.Databases[0].Name);



请全力帮助我,我要在客户端PC上通过setup.exe文件创建表,所有内容都应该自动获得.



please help me actully I wnat to create table on client pc throgh setup.exe file all thing should get attomaticlly thanks

推荐答案

您的PC上是否正在运行SQL Server Browser服务?
Is the SQL Server Browser service running on your PC?


这篇关于smo不提供我的PC上已安装的sql server实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆