Problem with the Database access

Last post 07-07-2009 2:59 PM by rajesh876. 4 replies.

Sort Posts:

  • Problem with the Database access

    07-07-2009, 11:54 AM
    • Member
      16 point Member
    • rajesh876
    • Member since 02-25-2009, 12:14 PM
    • Posts 70

    Hello,


    I am having the problem with accessing database.

    It works fine on my development machine.But When i deployed it to a production server which is in DMZ,I am getting the following

    error.

    An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server).

    My web.config file is


    <configuration>
        <appSettings>
            <add key="ConnectionString" value="server=vvvv;database=DBTest;uid=sa;password=yyyyy;"/>
        </appSettings>
        <connectionStrings/>

    <authentication mode="None">
            </authentication>
            <authorization>
                <allow users="*"/>
            </authorization>


    vvvv  is an intranet server where i kept the database.

    My question is what do i need to change in the  web.config inorder to access the application even though it is in DMZ.

  • Re: Problem with the Database access

    07-07-2009, 12:11 PM
    Answer
    • Star
      7,932 point Star
    • amit.jain
    • Member since 10-06-2008, 5:09 AM
    • Delhi India
    • Posts 1,264

    refer this

    http://www.connectionstrings.com/sql-server-2005

    find which connection string works for u


    Don't say thanks rather mark my reply as "Answer" if it helps you ,Doing so u'll get points too
    amiT jaiN

    ASP.NET C#.NET Articles
  • Re: Problem with the Database access

    07-07-2009, 12:24 PM
    • Member
      16 point Member
    • rajesh876
    • Member since 02-25-2009, 12:14 PM
    • Posts 70

    I tried by adding Trusted_Connection = True


    and even Integrated Security= SSPI;

    But nothing is working for me.

    Please suggest me as the application is in DMZ.


    Thanks

  • Re: Problem with the Database access

    07-07-2009, 2:48 PM
    Answer
    • Member
      314 point Member
    • ksqcoder
    • Member since 06-01-2009, 6:21 PM
    • Posts 43

    I usually use something like this in my Web.config:

    <connectionStrings>
    
    <add name="ConnectionString" connectionString="Data Source=12.34.56.78;Initial Catalog=DB_Name_Here;UID=User_ID_Here;Password=Password_Here;providerName="System.Data.SqlClient"/>
    
    </connectionStrings>

    The Data Source is the IP of the SQL Server.

  • Re: Problem with the Database access

    07-07-2009, 2:59 PM
    • Member
      16 point Member
    • rajesh876
    • Member since 02-25-2009, 12:14 PM
    • Posts 70


    yeah..it is working fine now...Thanks guys

Page 1 of 1 (5 items)