Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7962891
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:28:16+00:00 2026-06-04T05:28:16+00:00

I have a complex problem and I am not sure what is causing it.

  • 0

I have a complex problem and I am not sure what is causing it. The short of it is, I pretty much have access to test anything I need to, but I am not sure the best way to troubleshoot a database connection string issue in my scenario.

My development environment is quite a bit different than my test environment. My test environment is in a DMZ. My development environment is within the same domain as the database server.

In my development environment, I am running on my desktop and connecting with a connection string and using a trusted connection.

Int the DMZ I have deployed my files on a system drive that IIS 7 points to on the same server. Because the test environment is on the DMZ, I am using an ip address of the server and a special port number that I must specify in my connection string.

My web application does not house connection string. I keep connection string in a .cs file and based on Evironment.machineName variable in .Net, the application decides at runtime which connection string to use and stores that into a global static varibale so I basically have:

public static readonly string strDBConnDev = "connection stuff here";
public static readonly String strDBConnTest = "connection stuff here";

public static String strDBConn;

Then I have a function that fires on a pageload that runs

public static void setEnvVars()
{

// This is psuedocode

if(environment.machinename = "mydevmachine")

{       
strDBConn = strDBConnDev;
        }

        if(environment.machinename = "mytestmachine")
        {
            strDBConn = strDBConnTest;
        }
}

I make a connection on dev that is successful. The connection string, or something about it is not right. I am using the .Net Data Provider, using
System.Data.SqlClient. It is important that I continue to use this. I have not configured any connection string in the IIS 7 database section as that has not seemed to be necessary in our other environments.

According to an article I found: There are 2 formats. The one that my dev machine uses

// .NET DataProvider — Trusted Connection

using System.Data.SqlClient;

SqlConnection conn = new SqlConnection();
conn.ConnectionString =
"Data Source=ServerName;" +
"Initial Catalog=DataBaseName;" +
"Integrated Security=SSPI;";
conn.Open();

and the connection via ip that i need my test in the dmz to use:

// .NET DataProvider — via IP Address

using System.Data.SqlClient;

SqlConnection conn = new SqlConnection();
conn.ConnectionString =
"Network Library=DBMSSOCN;" +
"Data Source=xxx.xxx.xxx.xxx,[port number];" +
"Initial Catalog=DataBaseName;" +
"User Id=UserName;" +
"Password=Secret;";
conn.Open();

My conundrum is that I have troubleshot to the point that I know that that connection string variable is being set when in the DMZ. However my connection fails and yet I do not get an error. It just fails quietly. I checked IIS logs on the DMZ and found no evidence of a clue or hint. I also checked the windows Application logs and did not find anything there, which I thought was pretty surprising.

I feel stuck at this point because I feel like I need troubleshooting ideas so that I can understand and test the connection and visibility and credentials of the database server from my dmz host.

A little background in how I am deploying is that I am building on my machine, then copying the files to my c# web application to the folder on the dmz host. The code runs nice until it tries to make a call to the db.

I feel like I need some help with my “skills”, basically knowing when / how to troubleshoot and also what to ask of my network peeps.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T05:28:17+00:00Added an answer on June 4, 2026 at 5:28 am

    This problem had no response but the issue was solved. I troubleshot the connection by the following:

    1) Check accessibility from the dmz web host to the internal database server

    • I opened a telnet session on that port to the database host and
      confirmed that it was reachable.
    • Then I created an odbc connection to that host successfully

    2) Determine why connection string in my .net application was not working

    • I had a try/catch block around my code so it was failing silently and
      I couldn’t troubleshoot the message, so a co-worker suggested running
      LinqPad on the dmz host >>
    • I ran LinqPad on that server and wrote a very small db connection function in c# that I ran similar to exact to how my app was trying to connect. LinqPad gave me the error!

    Problem…I had created a database account (because you can’t use a trusted connection or Windows pass through authentication from dmz to internal db host) and I had not given the account any select access to the database.

    Problem solved by making sure my database account was set up the right way. It was the first time that I had heard of Linqpad, but it ended up being a really cool troubleshooting tool because you can run some .net scripts without having to even start a project or compile, so it saved some time.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have in mind a design problem that does not look like complex, but
I have somewaht of a strange problem. I am not sure if I am
I'm not sure if this is even possible, but here goes: I have a
I have a complex MySQL problem. SELECT * FROM banners, content_id_country, languages WHERE content_id_country.content_id
I have a complex sorting problem with my SQL statement. I have a table
I have a complex SQL problem in MS SQL Server, and in drawing on
I have a reasonably complex layout problem: I would like to have a main
I have a complex JPA/Hibernate problem. I have two entities A and B. A
I have some complex regular expressions which I need to comment for readability and
I have following complex query which I need to use. When I run it,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.