无法检索用于连接的AplicationSettings信息(对象名称,属性名称) [英] unable to retrieve AplicationSettings information (object name, property name) for connection

查看:124
本文介绍了无法检索用于连接的AplicationSettings信息(对象名称,属性名称)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

道歉,但我在表单论坛上无所作为,并且面临着必须完全重写应用程序的前景.


可能是个线索 虽然是我无法摆脱我添加的表格.我已经删除了 从数据库中删除,从设计器中删除它并保存了文件,但是 只是不断出现!即使未显示,仍然有一个 .xsd文件中的表适配器.我不愿意开始对此进行编辑 手动进行操作,因为有可能将其他内容弄乱-我确实尝试过,但在其他地方却引起了错误(VS并未说明在何处)

Apologies for cross posting, but I have got nowhere with the forms forum, and am faced with the prospect of having to completely rewrite the application.


I have suddenly started to get this error message all the time - it seemed to start after I added a table to the schema, but deleting the table makes no  difference.   I can't see anything wrong with the connection string, but as it seems to be entirely undocumented, that doesn't mean much.   The connection string contains
DataSource=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\test.mdf;Integrated Security=True;User Instance=True
and certainly the string works when I use "test connection" from the application setting edit box.  I am assuming that for some reason it is not evaluating the Data Directory, but can't see any reason why it shouldn't.  Any ideas gratefully received!
What might be a clue though is that I can't get rid of the table I added.  I have deleted it from the database, deleted it from designer and saved the file, but it just keeps reapearing!  Even when it is not showing, there is still a table adapter in the .xsd file.  I am reluctant to start editing this manually because of the danger of screwing something else up - I did try but it caused an error somewhere else (VS helpfully didn't say where)

推荐答案

我会尝试检查xml .xsd文件的一部分.例如,只需在整个解决方案中快速查找,然后搜索关键字</Connection>".结果应该提取了您的< DataSetName> .xsd文件,并且选择应该在第一个Connection节点的结束标记处.验证这些设置是否正确.

,例如,

< 连接 "" 我的设置 AppSettingsPropertyName = ConnectionStringName " "" IsAppSettingsProperty = 真实 修饰符 = &; " ConnectionStringName(MySettings) &; &"; @ 属性参考 &"; ApplicationSettings.< ObjectName> .MySettings.GlobalReference.Default.ConnectionStringName " "" System.Data.SqlClient ></ 连接 >

如果不确定其外观,请创建一个新的项目解决方案,创建一个新的dataSet,然后将一个新表放到dataSet中.然后,检查设计器生成的代码.

I'd try examining the xml portion of your .xsd file. For example just do a quick find within your entire solution, searching for the keyword '</Connection>'. The result should have pulled up your '<DataSetName>.xsd' file, and the selection should be at the closing tag of your first Connection node. Verify that these setting are correct.

e.g.,

<Connection AppSettingsObjectName="MySettings" AppSettingsPropertyName="ConnectionStringName" ConnectionStringObject="" IsAppSettingsProperty="True" Modifier="Assembly" Name="ConnectionStringName (MySettings)" ParameterPrefix="@" PropertyReference="ApplicationSettings.<ObjectName>.MySettings.GlobalReference.Default.ConnectionStringName" Provider="System.Data.SqlClient"></Connection>

If you are unsure of what this should look like, create a fresh project solution, create a new dataSet, and drop a new table into the dataSet. Then, examine the designer generated code.


这篇关于无法检索用于连接的AplicationSettings信息(对象名称,属性名称)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆