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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T17:46:31+00:00 2026-06-18T17:46:31+00:00

I have my sql data source but i want my program to dynamically bind

  • 0

I have my sql data source but i want my program to dynamically bind it to the data source.
I want my dataAdapter to bind to the data file by looking it through the project folder(source folder of the project/app). How can i dynamically produce a ConnectionString that will locate and bind itself to the MyData.mdf file ?

  • 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-18T17:46:32+00:00Added an answer on June 18, 2026 at 5:46 pm

    you can use your C# file to implement the code their to establish a connection string.

    public SqlConnection GetConnection()
    {
    string connectionString = ConfigurationManager.ConnectionStrings['"' + DatabaseName + '"' ].ConnectionString;
    SqlConnection con = new SqlConnection (connectionString);
    return con;
    }
    

    In the above mentioned statement you can dynamically call in the Database variable and run the GetConnection() method to create a connection to that particular database
    In your web.config add your file location

    <connectionStrings>
     <add name="DynamicconnectionString" connectionString="Data Source = //your path for the DB file // "/>
    </connectionStrings>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a grid view utilizing sql data source. Now I want to delete
I have a repeater that's bound to a SQL Data Source (using ASP.NET). Are
I have written a program in C# to use SQL 2008. I want to
I want to create a SQL-like interface for a special data source which I
I'm in a situation where I have no choice but to use Data Source
I have two SQL Server databases with identical schemas, but different data. I also
I have a sql data source and I have a really long string of
I have a SQLDataSource that is bound to a ListView control but I want
I added an Access database as a Data Source in VB 2008. I want
I have a hierarchy table with the following data : SOURCE TARGET Level ID

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.