主页>技术社区>IT 技术>编程开发>C#

解决VS2005在Winform窗体设计界面中数据源窗口灰化不显示数据源的问题

eIT.com.cn 2022/11/26 23:24:48 阅读 63 次

打印



近日发现问题,在项目中了几个数据源,当在Code界面时,数据源窗口可以出我的数据源,但是一切换到窗体设计界面,数据源窗口就灰化,数据源窗口中所有的数据源都消失了,切换到Code界面,数据源有出来了,切换到设计界面,又消失了,百思不得其解,一定是VS出问题了……

最后经过一顿,原因可能出在“WinFormControls.xml ”上,这个在

<DriveLetter>:\Documents and Settings\<UserName>\Application Data\Microsoft\Visual Stu\8.0\DataBindingSetting\WinFormControls.xml

首先VS2005,然后查看这个中的,看看Sy.Windows.Forms 的版本号是不是2.0.0.0,如果不是,就改成2.0.0.0

如果是2.0.0.0,那么只能这个。

按如上操作之后,就可以这个问题了。

When I am looking at a code window all of my data sources are visible in the data sources tool. When I am looking at a form, the tool is empty and greyed out and no options can be accessed. This is exactly opposite from how it worked in beta 1, 2 and RC1.

Anyone k what the deal is with this? As of right I cannot drag/drop a table onto a form because all the tables are hidden when I am looking at a form.
The problem is that for some reason in the dialogue where you can select which controls go with each data type, there were multiple versions of some controls listed. For example for the String datatype, there were two text controls listed and selected, for the [LIST] data type, there were two GridView controls selected. One of the controls in each case is version 2.0.0.0, and the other is version 2.0.2600.0. However on one developer machine, there were not any duplicates, but this solution worked for that machine as well.

The solution:

1) Go into tools->options and then select Windows Forms Designer -> Data UI Customization.

2) Select each datatype that is in the drop down list, and all controls. Do this for each and every datatype. This should bring the datasources back into view when you are looking at a form designer window.

3) To be able to again drag and drop the table or field onto a form, you will need to go back into the Ui Customization dialog and select the correct form controls to associate with each datatype, and it is also a good idea to set a default for each. When I ed all checked items, and clicked ok, and then went back in, the invalid duplicate controls were no longer listed in the dialog, so you cannot accidentally re-select the wrong controls.
Here's a possible explanation for this issue. I will verify it.
- When you change Data UI Customization, the settings are saved under C:\Documents and Settings\<UserName>\Application Data\Microsoft\VisualStu\8.0\DataBindingSetting\WinFormControls.xml. The full assembly name, including the version is saved.
- Between Beta and RC, the version number was changed.
- MSI engine does not k about this file so it remains there between updates.
- Data Sources tool window loads the settings file, cannot find the controls with the old version numbers and fails.

我通过安装VS2005 SP1了这个问题。

http://forums.microsoft.com/msdn/showpost.aspx?postid=125310&siteid=1
(http://www.cnblogs.com/ricky81317/archive/2006/12/29/606798.html)
()
(http://forums.microsoft.com/msdn/showpost.aspx?postid=89678&siteid=1)
(https://connect.microsoft.com/VisualStu/back/Viewback.aspx?backID=123477)


总结

以上是为你收集整理的全部内容。

如果觉得网站内容还不错,欢迎将推荐给好友。






相关内容


热门栏目


特别声明


最新资讯
热讯排行



合作媒体友情链接
生活常识小贴士 软件开发教程 智慧城市生活网 息县通生活服务[移动版] 息县商圈[移动版] 美食菜谱
健康养生 法律知识 科技频道 电影影讯 留学考研学习 星座生肖|解梦说梦




关于我们 | 联系我们 | 合作媒体 | 使用条款 | 隐私权声明 | 版权声明

      Copyright © 2023 eIT.com.cn. All Rights Reserved. 豫ICP备2022012332号