4 Replies - 14914 Views - Last Post: 03 October 2011 - 08:03 PM Rate Topic: -----

#1 toxifier   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 29
  • Joined: 27-September 11

Database Connectivity problem on remote server

Posted 02 October 2011 - 08:51 PM

Hi,
I am new in web designing and this is what is happening on the database:

When i debug my website on local host, it works absolutely fine for me.
But, when i deployed it on net, database is showing me the error.
The Error i am getting is:

Server Error in '/' Application.
--------------------------------------------------------------------------------

Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".

<!-- Web.Config Configuration File -->

<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.

[code]
<!-- Web.Config Configuration File -->

<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>
</configuration>

[\code]


What should i do to rectify it?
Thank you in advance for the help.

Is This A Good Question/Topic? 0
  • +

Replies To: Database Connectivity problem on remote server

#2 Frinavale   User is offline

  • D.I.C Addict
  • member icon

Reputation: 205
  • View blog
  • Posts: 776
  • Joined: 03-June 10

Re: Database Connectivity problem on remote server

Posted 03 October 2011 - 06:56 AM

You should set the custom errors mode to "off" so that you can see the error message...
Otherwise you'll have to gain access to the Windows Event Logs on the web server to see more details about the error.

-Frinny
Was This Post Helpful? 0
  • +
  • -

#3 toxifier   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 29
  • Joined: 27-September 11

Re: Database Connectivity problem on remote server

Posted 03 October 2011 - 10:56 AM

okay i have done it

now this is what happens when i open the webpage:

Server Error in '/' Application.
--------------------------------------------------------------------------------

The connection name 'qweConnectionString1' was not found in the applications configuration or the connection string is empty.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: The connection name 'qweConnectionString1' was not found in the applications configuration or the connection string is empty.

Source Error:

Line 28:         </Columns>
Line 29:     </asp:GridView>
Line 30:     <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
Line 31:         ConnectionString="<%$ ConnectionStrings:qweConnectionString1 %>" 
Line 32:         ProviderName="<%$ ConnectionStrings:qweConnectionString1.ProviderName %>" 



Source File: c:\inetpub\vhosts\kadvtg.com\httpdocs\Clients.aspx Line: 30

Stack Trace:

[InvalidOperationException: The connection name 'qweConnectionString1' was not found in the applications configuration or the connection string is empty.]
   System.Web.Compilation.ConnectionStringsExpressionBuilder.GetConnectionString(String connectionStringName) +2473398
   ASP.clients_aspx.__BuildControlSqlDataSource1() in c:\inetpub\vhosts\kadvtg.com\httpdocs\Clients.aspx:30
   ASP.clients_aspx.__BuildControl__control8() in c:\inetpub\vhosts\kadvtg.com\httpdocs\Clients.aspx:21
   ASP.clients_aspx.__BuildControl__control7(HtmlTableCellCollection __ctrl) in c:\inetpub\vhosts\kadvtg.com\httpdocs\Clients.aspx:20
   ASP.clients_aspx.__BuildControl__control6() in c:\inetpub\vhosts\kadvtg.com\httpdocs\Clients.aspx:20
   ASP.clients_aspx.__BuildControl__control2(HtmlTableRowCollection __ctrl) in c:\inetpub\vhosts\kadvtg.com\httpdocs\Clients.aspx:13
   ASP.clients_aspx.__BuildControltblmnclnts() in c:\inetpub\vhosts\kadvtg.com\httpdocs\Clients.aspx:13
   ASP.clients_aspx.__BuildControlContent2(Control __ctrl) in c:\inetpub\vhosts\kadvtg.com\httpdocs\Clients.aspx:12
   System.Web.UI.CompiledTemplateBuilder.InstantiateIn(Control container) +12
   ASP.masterpage_master.__BuildControlcph1() in c:\inetpub\vhosts\kadvtg.com\httpdocs\MasterPage.master:63
   ASP.masterpage_master.__BuildControl__control32() in c:\inetpub\vhosts\kadvtg.com\httpdocs\MasterPage.master:62
   ASP.masterpage_master.__BuildControl__control30(HtmlTableCellCollection __ctrl) in c:\inetpub\vhosts\kadvtg.com\httpdocs\MasterPage.master:59
   ASP.masterpage_master.__BuildControl__control29() in c:\inetpub\vhosts\kadvtg.com\httpdocs\MasterPage.master:59
   ASP.masterpage_master.__BuildControl__control5(HtmlTableRowCollection __ctrl) in c:\inetpub\vhosts\kadvtg.com\httpdocs\MasterPage.master:13
   ASP.masterpage_master.__BuildControltblmnmstr() in c:\inetpub\vhosts\kadvtg.com\httpdocs\MasterPage.master:13
   ASP.masterpage_master.__BuildControlform1() in c:\inetpub\vhosts\kadvtg.com\httpdocs\MasterPage.master:12
   ASP.masterpage_master.__BuildControlTree(masterpage_master __ctrl) in c:\inetpub\vhosts\kadvtg.com\httpdocs\MasterPage.master:1
   ASP.masterpage_master.FrameworkInitialize() in c:\inetpub\vhosts\kadvtg.com\httpdocs\MasterPage.master.cs:912307
   System.Web.UI.UserControl.InitializeAsUserControlInternal() +35
   System.Web.UI.MasterPage.CreateMaster(TemplateControl owner, HttpContext context, VirtualPath masterPageFile, IDictionary contentTemplateCollection) +8680831
   System.Web.UI.Page.get_Master() +51
   System.Web.UI.Page.ApplyMasterPage() +15
   System.Web.UI.Page.PerformPreInit() +45
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +282





--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.5446; ASP.NET Version:2.0.50727.5420
Was This Post Helpful? 0
  • +
  • -

#4 Frinavale   User is offline

  • D.I.C Addict
  • member icon

Reputation: 205
  • View blog
  • Posts: 776
  • Joined: 03-June 10

Re: Database Connectivity problem on remote server

Posted 03 October 2011 - 12:36 PM

Do you have a "qweConnectionString1" defined in your web.config file?
If so, is it defined in the right place?
Was This Post Helpful? 0
  • +
  • -

#5 toxifier   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 29
  • Joined: 27-September 11

Re: Database Connectivity problem on remote server

Posted 03 October 2011 - 08:03 PM

Yes it is defined
and since it was defined by default, so I think it must be in the right place
Connection string is same though:
<connectionStrings>
<add name="qwe.ConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\asdf.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>
</connectionStrings>


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1