Visual Studio 2017 the connection string could not be found in application settings
Asked Answered
S

3

6

For connection database and reading data, I am using a dataset which read connection string from Web.config file. Everything working in Visual Studio 2013. But when I opened this project in Visual Studio 2017, I can't configure. It errors:

Unable to find connection string xxxx. the connection string could not be found in application settings or the data provider associated with the connection string could not be loaded

enter image description here

Sopor answered 11/9, 2018 at 23:26 Comment(8)
me too same problem; hope next VS version solve the problem..Milch
still the problem exists.Sopor
Is there anything in the conversion/upgrade log upgrading the solution? When you open a solution in a new visual studio then it creates a log with warnings and errors if there are any. I think it is called upgradelog.htm and put besides the solution.Sterlingsterlitamak
@Uwe no warning in the UpgradeLog.htmSopor
Please, read this: social.msdn.microsoft.com/Forums/windows/en-US/… A common reason of this error is duplicated entry in web.config file.Polychromy
@MaciejLos There is no duplicate entry. This has only happened after the upgradeSopor
@EmanueleGreco Update the VS to 15.9. The problem fixed for me.Sopor
@Sopor thanks, this worked for me tooMilch
S
0

Update the VS to 15.9. This will fix the existing problem

Sopor answered 9/12, 2018 at 22:47 Comment(0)
T
8

Try to update your Visual Studio to 15.9 in the first place. And if it didn't fix the problem, try the following steps:

  • Close the DataSet window with the error.
  • Right click the DataSet in the solution explorer.
  • Select "Open with…" from the context menu.
  • Select "Source Code (Text) Editor" from the list and press the "OK" button.

Near the top of the file, you'll see a element with several elements within it. Most DataSet should only have one element. If you are having trouble like I've described above, you'll have at least two and one will be incorrect. Delete it or otherwise fix it, save the file and reopen normally.

References:

https://blog.dmbcllc.com/unable-to-find-connectionfor-object-webconfig/

Problem to update my dataSet designer : Unable to find connection 'ERMConnectionString (Settings)1'

Failed to load dataset because of the following error: Unable to find connection ...

Dataset Designer: "Unable to find connection MyConn (MySettings)1 for object 'MySettings'"

Unable to find connection 'MyConnName' for object 'Web.config' in Table Adapter configure Properties

Translative answered 2/12, 2018 at 7:58 Comment(1)
Update the VS to 15.9. The problem fixed for meSopor
A
3

This is a TableAdapter error. TableAdapters provide communication between your application and a database. Some people alleged that seems The Visual Studio 15.8.x no longer uses the connection string in the web.config while you may have not any problem in prior versions like 15.7.x.

Any way I believe you can reproduce a working one by using one of approaches listed in How to: Save and edit connection strings.

Abram answered 3/12, 2018 at 0:17 Comment(1)
Update the VS to 15.9. The problem fixed for meSopor
S
0

Update the VS to 15.9. This will fix the existing problem

Sopor answered 9/12, 2018 at 22:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.