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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:08:48+00:00 2026-06-13T04:08:48+00:00

I added database file to my built in sql server of Visual Studio and

  • 0

I added database file to my built in sql server of Visual Studio and i have also connection string of it but i am confuse how to add this connection string into web.config
here is my try to add connection string to code below :

<connectionStrings>
   <add name="myFirstConnectionString" connectionString="Data Source= .\SQLEXPRESS;AttachDbFilename="C:\Users\Ahdus\Desktop\First Task\First Task\MyFirstTask.mdf"; Integrated Security=True;Connect Timeout=30;User Instance=TrueproviderName="System.Data.SqlClient" />
  </connectionStrings>

I am much confused that how i can add connection string of my visual studio built in database file to web.config.
Please help me as i am new in asp.net and ignore my way of asking.

  • 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-13T04:08:49+00:00Added an answer on June 13, 2026 at 4:08 am

    To make your connection string work with the path you’ve given, it should look somewhat like this:

    Visual Studio 2012 (SQL Server 2012):

    <connectionStrings>
      <add name="myFirstConnectionString" 
           connectionString="Data Source=(LocalDB)\v11.0;Integrated Security=True;AttachDBFilename=&quot;C:\Users\Ahdus\Desktop\First Task\First Task\MyFirstTask.mdf&quot;;Integrated Security=True" 
           providerName="System.Data.SqlClient"/>
    </connectionStrings>
    

    Visual Studio 2010 (SQL Server 2010):

    <connectionStrings>
      <add name="myFirstConnectionString"
           connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=&quot;C:\Users\Ahdus\Desktop\First Task\First Task\MyFirstTask.mdf&quot;;User Instance=true"
           providerName="System.Data.SqlClient" />
    </connectionStrings>
    

    But you should consider moving the database file to the App_Data folder in your project, and then use AttachDBFilename=|DataDirectory|MyFirstTask.mdf instead.

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

Sidebar

Related Questions

I've created a Database project (.dbproj project file) in Visual Studio 2008, added a
I have a project with a SQL Server Compact database included. I build the
If we already have a database file in .sql format, how can we load
I have a MySQL user added to a database that I would like to
My sql database doesn't allow 2 records to be added with the same number.
I have added a field in my MySQL Database, which is a DateTime field.
I recently added a stored procedure to my SQL Azure database. I added that
I've added 3 strings of data into a SQL database in android. A fourth
We have a simple file browser on our intranet, built using ASP/vbscript. The files
I have two database projects DB_A and DB_B. Project DB_A references DB_B. I added

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.