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

假装没事ソ 提交于 2019-12-24 08:32:06

问题


I want to change the query in table adapter but it's not opening & throwing an error "Configure table Adapter Failed" & in property of connectionString it says "Unable to find connection 'ConnStringName' for object 'Web.config'. The connection string could not be found in application settings, or the data provider associated with the connection string could not be loaded"


回答1:


I have been looking for a solution for this problem for a long time. Thankfully I found a solution that worked for me.

  1. Close the dataset window with the error.
  2. Right click the dataset in the solution explorer.
  3. Select “Open with…” from the context menu.
  4. 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 datasets 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.

This is the page where I found it out. See the complete answer here




回答2:


Seems like there no ConnStringName parameter in connectionString section of Web.config

<connectionStrings> 
    <add name="ConnStringName" providerName="" connectionString=""/>
</connectionStrings>

Updated: The problem is in missing reference to System.Data.OracleClient. To solve this just add reference on missing provider.



来源:https://stackoverflow.com/questions/40101459/unable-to-find-connection-myconnname-for-object-web-config-in-table-adapter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!