Solved

Database retrieval is not visible in the webpage.

Posted on 2011-03-19
5
237 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

757 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now