• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

添加列多到数据库表时,你让你的datagridview显示的变化

用户头像
it1352
帮助1

问题说明

我在Visual Studio中的一个项目,它指向一个表在我的数据库中创建一个数据集 然后绑定一个DataGridView控制它。

I have created a dataset in a project in visual studio that points to a table in my database and then bound a datagridview control to it.

现在我打开数据库,另一列添加到数据库中的表。 然后我打开数据库和更新它的配置包括更改。

Now I open the database and add another column to the table in the database. Then i open the dataset and update it's configuration to include the change.

然后我想更新datagridview的,但我不能添加新列。 我可以用鼠标右键点击的TableAdapter在DataGridView中的格式,并得到正确的表中的数据了。

Then i want to update the datagridview, but I can't add the new column. I can right click on the tableadapter in the form where the datagridview is and get the correct table data up.

这并不重要,如果我删除形式的TableAdapter和的BindingSource和数据集中实例的关系,然后尝试重新绑定,在DataGridView仍然不会让我添加新列。

It does not matter if I delete the tableadapter and the bindingsource and dataset instance from the form, and then try and rebind it, the datagridview still won't let me add the new column.

没有任何人有一个想法发生了什么事?
我已经试过这几个项目,无论是VS2008和2010测试版,而不是与其他语言比C#寿。
唯一的解决办法,到目前为止似乎是做一个完全不同的数据集,但必须有一个更好的办法。

Does anyone have an idea what is happening?
I've tried this with several projects, both VS2008 and 2010 beta, not with other languages than C# tho.
The only solution so far seems to be to make a whole different dataset, but there has to be a better way.

在此先感谢

正确答案

#1


中的文件夹 C:\ Users \用户YOURUSERNAME \应用程序数据\本地\微软\的VisualStudio \ 9.0 \ ProjectAssemblies
Visual Studio中有编制的东西,它使用的快速参考的负载。这些都是经过一番散列方案命名的,所以我们无法分辨哪一个是我们的拙劣表计划的编制设置。
1.我们首先关闭Visual Studio的(我只是做了它是在安全方面)
2.删除ProjectAssemblies文件夹中的所有文件夹。

Under the folder in
"C:\Users\YOURUSERNAME\AppData\Local\Microsoft\VisualStudio\9.0\ProjectAssemblies"
visual studio has a load of compiled things it uses for quick reference. These are named after some hashing scheme so we can't tell which one is the compiled settings for our botched table scheme.
1. We start by closing Visual Studio (I just did it to be on the safe side)
2. Delete all the folders in the ProjectAssemblies folder.
3. Open up Visual Studio again
4. Rebuild solution
5. And NOW we get the correct values when we add columns to our datagridview.

呼! :D

这篇好文章是转载于:学新通技术网

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 学新通技术网
  • 本文地址: /reply/detail/tanhceafak
系列文章
更多 icon
同类精品
更多 icon
继续加载