I have developed a website in asp.net and upload onto a server. But I unable to connect to my SQL Server database (on localhost
, I am able to run but not on the server)
I am using following code.
con = new SqlConnection("server=**********,****\\sqlexpress;Database=******;User ID=******;Password=*********");
con.Open();
but I'm unable to open the connection.
I am getting this error related to web.config
:
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the defaultRedirect
attribute of the application's <customErrors>
configuration tag to point to a custom error page URL.
<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>
</configuration>
So please help me how can resolve it