数据集设计师 - 更新表? [英] Dataset designer - update table?

查看:55
本文介绍了数据集设计师 - 更新表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我认为这是你们在RTM之前修复的一个问题,它是自第一个测试版以来的产品。

当数据库中的表发生变化时(例如新列添加或更改列类型),更新数据集架构的唯一明显方法是使用"配置..."选项并再次完成向导。

现在,这显然*尝试*来更新查询定义,但我得到的结果简直是可怕的:最后添加了新列,将类型更改的列添加为列的第二个副本,并使用新的名称添加"1" type,并且原始列保留在旧类型中,并且通常,辅助查询的select命令中的列按其顺序加扰。

SELECT Id,Código,Nombre,Descripción,CategoríaArtículo,Proveedor,Costo,ComisiónBase,TipoFiscal,Test,LogFecha,LogCostoFecha,LogComisiónFecha,LogUsuario,L​​ogAplicación,LogHostFROMArtículoWHERE(Id = @Id)

自动转换为:

SELECTCategoríaArtículo,ComisiónBase,Costo,Código,Descripción,Id,LogAplicación,LogComisiónFecha,LogCostoFecha,LogFecha,LogHost,LogUsuario,Nombre,Proveedor,Test ,TipoFiscal来自ArtículoWHERE(Id = @Id)

这应该如何运作?我是否真的需要删除整个表及其所有查询并从头开始?

请注意这是在VS 2003中工作。当您添加列或更改列类型然后使用"生成数据集。 .."在SqlDataAdapter上,选择相同的现有数据集,它会以正确的方式和顺序自动更新列。

让我直接前进,为您猜几个答案:<答:"这是设计的"(我最喜欢的)。
B)我们只是没有时间实现这个(更诚实一点,虽然这个VS发布时间有点晚)。
C)......?

I thought this was a problem you guys were fixing before RTM, it was in the product since the first beta.

When a table in the database changes (eg. a new column is added or a column type is changed), the only apparent way to update the dataset schema is to use the "Configure..." option and go through the wizard again.

Now, this apparently *tries* to update the queries definitions but the results I'm getting are simply horrendous: new columns are added at the end, columns whose types changed are added as a second copy of the column adding a "1" to the name with the new type, and the original column remains there with the old type, and in general, the columns in the secondary queries' select commands are just scrambled in its order.

SELECT Id, Código, Nombre, Descripción, CategoríaArtículo, Proveedor, Costo, ComisiónBase, TipoFiscal, Test, LogFecha, LogCostoFecha, LogComisiónFecha, LogUsuario, LogAplicación, LogHost FROM Artículo WHERE (Id = @Id)

is automagically converted to:

SELECT CategoríaArtículo, ComisiónBase, Costo, Código, Descripción, Id, LogAplicación, LogComisiónFecha, LogCostoFecha, LogFecha, LogHost, LogUsuario, Nombre, Proveedor, Test, TipoFiscal FROM Artículo WHERE (Id = @Id)

How is this supposed to work? Do I really need to delete the whole table and all its queries and start from scratch?

Please note this was WORKING in VS 2003. When you added columns or changed columns types and then used "Generate dataset..." on the SqlDataAdapter, choosing the same existing dataset, it would automatically update columns in the correct way and order.

Let me just go right ahead and guess a couple of answers for you:
A) "This is by design" (my favorite).
B) We just didn't have the time to implement this (a little more honest, although you're a little late for this VS release).
C) ... ?

推荐答案

我想知道的是有没有关于这个问题的最新消息?

I would like to know is there any updated news for this issue?

我认为VS2005已经发布了一段时间。这个问题有没有补丁或其他东西?

I think VS2005 has been released for a while. Is there any patch or something for this problem?

我想这个操作并不那么困难。它只需要匹配数据集架构和数据库架构中的列名称。实际上,我希望这会自动发生,就像在TableAdapter中修改select语句时更新insert,update,delete语句一样。

I guess this operation is not so difficult. It only requires to match the column name in the dataset schema and database schema. Actually, I expect this to be happened automatically, just like updating the insert, update, delete statement when you modify the select statement in the TableAdapter.


这篇关于数据集设计师 - 更新表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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