开发者

Trying to add a datatable to a DataSet

I'm trying to update an existing DataSet with a new table (programatically created, not from a DB). The minute I do anything with the DataSet, whether it's add a table, or move a table somewhere else on the designer, or literally anything that makes it be flagged as "unsaved" the application fails to build and gives 100+ errors in "DataSet1.xsd" (but the file is DataSet.xsd without the "1") that say such-and-such method is already declared in the class, which is it in the real class, not this DataSet1.xsd class that is coming out of nowhere. The only way for me to fix it is to actually go into my VCS and revert the file; just doing an Undo won't fix it and it'll still throw these errors, but after a revert it will compile and run correctly although I haven't changed anything!

What am I doing wrong here? The errors are being thrown in this "DataSet1.xsd" class but the actual file is just "DataSet.xsd"

I've done a Clean/Rebuild but to no avail. I haven't used DataSets in ages so I forget if there's some quirk here I need to do...

EDIT: So I've discovered that making a change开发者_如何学Python to DataSet.xsd creates DataSet1.Designer.cs which causes errors, and deleting that file fixes the errors without, it seems, affecting my changes. However, although the tables I add manually appear on the dataset designer, they aren't put into the code and I'm unable to access them programmatically.


Not a real answer, however:

The whole dataset paradigm was, IMHO, a bad implementation of a bad design.

Some interesting reading:

https://web.archive.org/web/20210125132705/https://www.4guysfromrolla.com/articles/050405-1.aspx
and it's follow up:
https://web.archive.org/web/20210125131938/https://www.4guysfromrolla.com/articles/051805-1.aspx

and a good discussion here on SO:
Why do we still use DataSets in .NET?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜