检测到sql实例,即使我卸载了sql 2008 express [英] sql instance detected even I uninstalled sql 2008 express

查看:80
本文介绍了检测到sql实例,即使我卸载了sql 2008 express的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用SqlDataSourceEnumerator.Instance.GetDataSources()来查找我的机器中是否安装了sql实例。



我已经安装了sql server 2008机器,然后完全卸载,它没有显示任何错误。



SqlDataSourceEnumerator.Instance.GetDataSources()在Windows 7或xp中完美运行,检查是否安装了sql或不是。



但是当我在Windows 8中安装然后卸载sql时,代码会一直返回先前安装的实例。

我检查了注册表以及程序文件。 Sql无处可去。



当我重新安装sql时,安装时也没有错误。



那么如何SqlDataSourceEnumerator在Windows 8中获取实例?



如果SqlDataSourceEnumerator检查是否安装了sql是不可靠的,那我怎样才能通过c#检测到它。



请注意,我需要64位和32位机器的程序,虽然我使用的是wow6432安装程序。

I am using SqlDataSourceEnumerator.Instance.GetDataSources() to find if sql instance is installed in my machine or not.

I have installed sql server 2008 in my machine,then uninstalled completely,and it didn't show any error.

SqlDataSourceEnumerator.Instance.GetDataSources() works perfectly in windows 7 or xp to check if sql installed or not.

But when I install and then uninstall sql in windows 8,the code all time returning the instance what was previously installed.
I've checked registry as well as programfiles. Sql is nowhere.

When I reinstall sql it is installing with no error also.

So how SqlDataSourceEnumerator getting instance in windows 8?

If SqlDataSourceEnumerator is not reliable to check if sql installed or not,then how can I detect that by c#.

Mind it I need a procedure for both 64 and 32 bit machine though I'm using wow6432 installer.

推荐答案

解决了我自己。



实际上我的机器在网络中,它正在获取其他机器的sql实例。在禁用网络之后它现在没问题了。



但是在windows xp中,虽然那是在网络中,但它没有返回实例。对于Windows 7和8它正在获取来自network的实例。这个方法不能在xp中通过网络获取实例吗?
Solved by myself.

Actually my machine was in network and it was fetching other machine's sql instance. After disabling network it is now ok.

But in windows xp,though that was in network,it didn't return instance.For windows 7 and 8 it is fetching instances from network.So does this method not fetch instance over network in xp?


这篇关于检测到sql实例,即使我卸载了sql 2008 express的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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