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 8137101
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T10:59:06+00:00 2026-06-06T10:59:06+00:00

I have a Windows Forms app written in C#, and part of the app

  • 0

I have a Windows Forms app written in C#, and part of the app has a Reporting form using RDLC reports and a ReportViewer control.

In order to create the reports, for each report I first created a DataSet and added a TableAdapter to the DataSet. I used the TableAdapter wizard to specify the query for the report, and I selected a ConnectionString that was already defined in App.Config and is used elsewhere in the application.

Everything works fine on my development box, but when I move the app to production where the database password isn’t the same as my dev box, the reports all fail to run with the exception that the ‘sa’ password is invalid.

Now, the password is set properly in the ConnectionString in app.config in production. I use this same ConnectionString everywhere else in the app, including to log in, so I know that the sa password is set properly.

It seems to me that when I add a TableAdapter to a DataSet using the wizard, and it asked me to choose a connection (which I chose the existing connection that was already in app.config and is used elsewhere in the app), it must be storing it somewhere and not always reading it from app.config. Or am I misunderstanding something?

I just want each DataSet with its TableAdapter to be able to use the connection string from app.config, which includes the username and password.

Does anyone know how to do that?

  • 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-06T10:59:08+00:00Added an answer on June 6, 2026 at 10:59 am

    I hacked around this by doing the following before calling the Fill method on the TableAdapter…

    this.EMPLOYEETableAdapter.Connection.ConnectionString =
      ConfigurationManager.ConnectionStrings["MCLabor"].ToString();
    

    This works. It’s kind of lame though, and it definitely proves that when you create the TableAdapter using the wizard, and you select an existing connection from App.Config (from the Connections drop down box in the wizard), it doesn’t actually load that connection string from app.config at runtime. Does anyone know why, or what the real way to handle this is? I don’t like having to manually set the connection string for every TableAdapter for every DataSet for every report.

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

Sidebar

Related Questions

I have written a basic Windows Form app in C# that has an embedded
JI have written a .NET C# Windows Form app in Visual Studio 2008 that
In a Windows Forms app is there any control that allow to have a
I have a windows forms app written in C++/cli. I want to extend this
I have a windows form app written in C#. the main_form class instantiates an
I have a Windows Form app written in C#. Its job is to send
I have a Windows Forms app, that has a single ElementHost containing a WPF
I have a windows forms app with a textbox control that I want to
I have a Windows Forms app in C#/.NET4 with a SQL 2008 back end.
I have a windows forms app where I have split different functionality into several

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.