首页 > 其他分享 >解决VS2005在Winform窗体设计界面中数据源窗口灰化不显示数据源的问题

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

时间:2023-11-08 10:02:20浏览次数:35  
标签:灰化 form VS2005 数据源 controls version each 2.0

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


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

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

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

首先关闭VS2005,然后查看这个文件中的内容,看看System.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 toolbox. When I am looking at a form, the toolbox 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 know what the deal is with this? As of right now 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 textbox 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 deselect 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 deselected 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\VisualStudio\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 know 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://forums.microsoft.com/msdn/showpost.aspx?postid=125310&siteid=1)
(http://forums.microsoft.com/msdn/showpost.aspx?postid=89678&siteid=1)
(https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=123477)



标签:灰化,form,VS2005,数据源,controls,version,each,2.0
From: https://blog.51cto.com/emanlee/8245274

相关文章

  • sharding分表应用笔记(一)——分表数据源配置
    sharding分表应用笔记(一)——分表数据源配置目录sharding分表应用笔记(一)——分表数据源配置1前言2配置2.1相关依赖2.2命名空间配置2.2.1引入sharding命名空间2.2.2物理数据源配置2.2.3分表数据源配置3外部链接1前言应用背景:物理数据源只有一个;对于部分数据量大的表实行......
  • 多源异构数据源融合怎么做,用这个一步搞定
    多源异构数据源融合是将来自不同来源、不同类型和不同结构的数据整合在一起,以实现更全面、准确和综合的分析和决策支持。以下是一个详细的步骤指南,以帮助您了解如何进行多源异构数据源融合。1.确定数据需求和目标:-首先,明确您的数据需求和目标。确定您想要从数据中获取什么样......
  • 【初学Nacos小问题】Nacos同一个命名空间下配置的数据源在项目中是如何识别的!
    在user-service项目中添加一个bootstrap.yml文件,需要配置服务名、开发环境、nacos地址、后缀名,对应nacos添加的配置文件名。内容如下:spring:application:name:userservice#服务名称profiles:active:dev#开发环境,这里是devcloud:nacos:serv......
  • Centos7 部署gitea,使用sqlite作为数据源
    #创建用户git,指定登录shell为Bash,-d指定家目录默认/home/git,-m如果指定的家目录不存在,则创建该目录#踩坑:-r不分配登录shell和家目录useradd-s/bin/bash-d-mgit#编辑/etc/sudoers文件以允许git用户在执行sudo命令时无需密码vi/etc/sudoers在文件中找到以rootALL=......
  • 如何找到 SAP Fiori Elements 应用某个字段显示值具体的数据源试读版
    笔者将自己在SAP领域16年(2007~2023)的SAPUI5(Fiori)和OData开发的技术沉淀,进行了系统的归纳和总结,分别写成了三套由浅入深的学习教程,收到了不错的反响:零基础快速学习ABAP一套适合SAPUI5开发人员循序渐进的学习教程SAPOData开发实战教程-从入门到提高这三套教程都......
  • Nacos单机模式配置远程数据源、配置身份认证
    1.nacos介绍官网链接:https://nacos.io/zh-cn/docs/what-is-nacos.htmlGithub:https://github.com/alibaba/nacos/Nacos/nɑ:kəʊs/是DynamicNamingandConfigurationService的首字母简称,一个更易于构建云原生应用的动态服务发现、配置管理和服务管理平台。Nacos致力于......
  • Apache Presto:一个统一多数据源的SQL查询引擎
    ApachePresto是一个开源的分布式SQL查询引擎,它可以在大数据环境下进行交互式的数据分析。Presto允许用户使用熟悉的SQL语法在不同的数据源上进行查询,比如Hive、Cassandra、PostgreSQL、Kafka、MySQL、ElasticSearch等,让用户可以在不同数据源上进行统一查询。Presto的......
  • 转:SpringBoot禁止配置数据源?
    SpringBoot禁止配置数据源 boot中如果引入了数据源相关的依赖就会自动配置数据源,如果项目中不需要连接数据库,可以手动设置禁用数据源的配置@SpringBootApplication(exclude={DataSourceAutoConfiguration.class,MybatisAutoConfiguration.class}) 疑问是:数据源移除了为......
  • 轻松搞定多数据源配置,Spring Boot与Mybatis-Plus的完美结合!
    ......
  • SpringBoot2,Druid数据源常用配置
    spring:datasource:druid:driver-class-name:com.mysql.cj.jdbc.Driverurl:jdbc:mysql://localhost:3306/mybatis?serverTimeZone=UTCusername:rootpassword:rootmax-wait:2000#获取连接的最大等待时间initial-size:5......