数据库可与XP一起使用,但无法在Windows7中打开 [英] data base work with xp but it unable to open in Windows7

查看:116
本文介绍了数据库可与XP一起使用,但无法在Windows7中打开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

先生,
我的设置有问题.当我在Xp中工作时,它可以正常工作,但不能在Windows 7中工作....
连接字符串为

Sir ,
i have a problem with my setup. When i work in Xp its works correctly but it''s not working with Windows 7....
The connection string is

SqlConnection sqlcon = new SqlConnection("Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\crm.mdf;Integrated Security=True;User Instance=True");



谢谢....



Thanks....

推荐答案

要检查的几件事:
-mdf文件实际上在该位置是否存在
-您(实际上是SQL Server服务)是否具有必要的特权.在Windows 7中,程序文件目录受到更多的保护,因此您也可以尝试将数据库文件放置在其他位置,并查看其是否有效. (类似于c:\ database \ ...).
Few thing s to check:
- does the mdf file actually exist in that location
- do you (actually the SQL Server service) have necessary privileges. In windows 7 program files directory is more protected so also you can try placing the database file somewhere else and see if it works. (Something like c:\database\...).


这篇关于数据库可与XP一起使用,但无法在Windows7中打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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