.mdf文件显示托管错误 [英] .mdf file showing error on hosting

查看:71
本文介绍了.mdf文件显示托管错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在网站上使用Asp.net 4.0。我添加了.mdf文件来存储网站的一些数据,定义的连接字符串是

I am using Asp.net 4.0 In a website. I have added .mdf file to store some data of website the defined connection string is as

<add name="ConStr" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\Dasboard.mdf;User Instance=true" providerName="System.Data.SqlClient"/>





然后它抛出一个SQL连接的错误,但它在本地工作正常。

因此,我该怎么做才能解决这个问题。您的帮助将会很明显。



when I am deploying on the server then it is throwing an Error of sql connection but it is working fine at local.
Hence, what should I do to resolve that. Your assistance will be appreciable.

推荐答案

1。您的SQL Server名称可能不同,除了 source =。\SQLEXPRESS



请咨询您的服务提供商。



2.显示异常的错误描述,找出究竟发生了什么,将代码放在try块中,进行连接。
1. your SQL Server name may be different, other than source=.\SQLEXPRESS,

check with your service provider.

2. display the error description of the exception, to find out what exactly happened, put your code in a try block, where you are making a connection.


我上面的数据库没有在你的服务器上像本地一样。
I thing above database not attched in your server like local.


这篇关于.mdf文件显示托管错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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