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

  • Home
  • SEARCH
  • 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 648253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:48:42+00:00 2026-05-13T21:48:42+00:00

Is it possible to access the Data Connection added to the project in the

  • 0

Is it possible to access the Data Connection added to the project in the code?

I know that it is possible to access DataSets created using visual designer but I would like to access the connection only.

Edit:

It is possible to add Data Connection to the project in VS2008 via Tools > Connect to Database.

I would like to access this connection as an object in my code so that I would not have to specify connection string by myself.

  • 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-05-13T21:48:43+00:00Added an answer on May 13, 2026 at 9:48 pm

    I don’t think you can directly use the connection created by the IDE as if it were one of your project’s settings. However, the IDE provides similar functionality through the project properties.

    How you get to the properties varies slightly on which language/default configuration you are using. But in general you should be able to try these steps and see if they provide the functionality you wanted:

    1. Open your project.
    2. Find your project in the Solution Explorer and select the project.
    3. On the Project menu, choose the ‘ProjectName’ Properties menu item.
    4. The project properties tab should open. Select the “Settings” blade.
    5. If you have no settings you will be given the option to create a settings file. Do so if necessary.
    6. In the grid that is displayed, choose the first blank row and type “ConnectionString” into the name field.
    7. In the type drop-down, choose (Connection String)
    8. Click in the value field. When you activate this field, a little expansion button labeled “…” should appear. Click it.
    9. This will bring up a Connection settings dialog box.
    10. Choose your sever from the available drop-down.
    11. Configure your log on credentials to your liking.
    12. Select your database from the available drop-down.
    13. Test connection. If it is OK, then Click OK twice to return to the settings page.
    14. Save your settings.

    Now you should be able to access this connection string from your project code.

    VB.Net:

    Dim cs = My.Settings.ConnectionString
    

    C#:

    var cs = Properties.Settings.Default.ConnectionString;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

is it possible to access the InfoMessage event handler in a Linq2SQL data context?
I want to create a data access layer that works with any data provider.
Middle-tier component will execute the data access routines in application. The component will call
In our web applications, we seperate our Data Access Layers out into their own
I am using ASP.NET to open an Excel 2003 document hosted on the server.
Is it possible to control the properties of 'advancedgridcolumns' in 'advanceddatagrid' mxml tag. For
Are there any alternatives to LogonUser and for impersonating given account in order to
Is there a way to force all my network requests to be made through
Following the KISS principle , I suddenly realised the following: In .NET, you can

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.