Solved

Database retrieval is not visible in the webpage.

Posted on 2011-03-19
5
242 Views
Last Modified: 2012-08-13
Hi,
I could be able to connect to the database and the connection is success when ever I click the Test Database connection but it is not displaying any information from the DB tables.

I am getting this when I try to configure the ASP.NET  configuration.
----------------------------------------------------------------------------------------
Could not establish a connection to the database.
If you have not yet created the SQL Server database, exit the Web Site Administration tool, use the aspnet_regsql command-line utility to create and configure the database, and then return to this tool to set the provider.

but in fact I created the database connection and put the exact connection string but it is not displaying any information from the tables.

I have attached the web.config file code as well.
-------------------------------------

Thanks


<?xml version="1.0"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
	<connectionStrings>
		<add name="BestDB" connectionString="Data Source=E-COM;Initial Catalog=BestDB;Persist Security Info=True;User ID=sa;Password=*********" providerName="System.Data.SqlClient"/>
</connectionStrings>
  <appSettings>
    <add key="SiteTitle" value="Best" />
    <add key="SiteDescription" />
    <add key="TimeOffset" value="-5" />
    <add key="DaylightSaving" value="true" />
    <add key="CopyrightMessage" value="Copyright@Best.com,All Rights Reserved, 2010" />
    <add key="Best" value="Best" />
  </appSettings>
	<system.web>
		<compilation debug="true" targetFramework="4.0"/>
		<authentication mode="Forms">
			
      <forms loginUrl="**************.aspx" defaultUrl="Default.aspx">
        <credentials passwordFormat="Clear">
          <user name="Admin" password="********"/>
        </credentials>
      </forms>
		</authentication>
    <membership>
      <providers>
        <clear/>
        <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/"/>
      </providers>
    </membership>
    <profile>
      <providers>
        <clear/>
        <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/>
      </providers>
    </profile>
    <roleManager enabled="false">
      <providers>
        <clear/>
        <add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/"/>
        <add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/"/>
      </providers>
    </roleManager>
	</system.web>
	<system.webServer>
		<modules runAllManagedModulesForAllRequests="true"/>
	</system.webServer>
  <location path="********.master">
    <system.web>
      <authorization>
        <deny users="?"/>
        <allow users="*"/>
      </authorization>
    </system.web>
  </location>
  <location path="******.aspx">
    <system.web>
      <authorization>
        <deny users="?"/>
        <allow users="*"/>
      </authorization>
    </system.web>
  </location>
  <location path="*******************.aspx">
    <system.web>
      <authorization>
        <deny users="?"/>
        <allow users="*"/>
      </authorization>
    </system.web>
  </location>
  <location path="**********************.aspx">
    <system.web>
      <authorization>
        <deny users="?"/>
        <allow users="*"/>
      </authorization>
    </system.web>
  </location>
  <location path="**********************.aspx">
    <system.web>
      <authorization>
        <deny users="?"/>
        <allow users="*"/>
      </authorization>
    </system.web>
  </location>
  <location path="**********************.aspx">
    <system.web>
      <authorization>
        <deny users="?"/>
        <allow users="*"/>
      </authorization>
    </system.web>
  </location>
  <location path="*****************.aspx">
    <system.web>
      <authorization>
        <deny users="?"/>
        <allow users="*"/>
      </authorization>
    </system.web>
  </location>
  <location path="*****************.aspx">
    <system.web>
      <authorization>
        <deny users="?"/>
        <allow users="*"/>
      </authorization>
    </system.web>
  </location>
 <location path="**************.aspx">
    <system.web>
      <authorization>
        <deny users="?"/>
        <allow users="*"/>
      </authorization>
    </system.web>
  </location>
</configuration>

Open in new window

0
Comment
Question by:sivakugan
  • 4
5 Comments
 
LVL 3

Expert Comment

by:exceter
ID: 35171600
I suppose that your SQL server is 2005 or 2008.

Open Sql Server Configuration Manager -> Sql Server Network Configuration -> enable "Named pipes"
0
 

Author Comment

by:sivakugan
ID: 35171755
I done that as you advised but still I am getting the same thing. The information from db is not visible.
but I could see the static information in webpage. Further I am not getting any error also.
This is making me  hard to figure out the problem. The name pipe was disabled and I enabled it after u said but it didn't work out.
0
 

Assisted Solution

by:sivakugan
sivakugan earned 0 total points
ID: 35171996
Can anyone help me to resolve this issue plz?
0
 

Accepted Solution

by:
sivakugan earned 0 total points
ID: 35177395
I have resolved the problem myself. I didn't give enough permission to the SQL server login user.
thats why it didn't display any data from the database.
0
 

Author Closing Comment

by:sivakugan
ID: 35213341
I have resolved the problem myself. I didn't give enough permission to the SQL server login user.
thats why it didn't display any data from the database.
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question