开发者

Changing CommandText changes Parameters

I'm trying to edit the 开发者_运维知识库CommandText for the Insert Command in a TableAdapter in the Designer in vb.net. Whenever I make changes to the CommandText, Visual Studio (2008) automagically changes the Parameters to a Collection consisting of one Parameter that existed before editing the Command, immersed in a sea of complete garbage Parameters, and then I either have to undo (unless this was the first thing I tried editing, in which case I have to close the Designer to discard changes and reopen it) or manually change ALL the Parameters back to something that isn't complete garbage.

Has anybody seen anything like this, or know how to stop Visual Studio from murdering my carefully tended Parameters? Any way to change the CommandText without finding yet another reason to curse the name of M$ would be greatly appreciated.


Honestly, I have taken issue with the built-in designers since VB6. For one, they behave funny, like your situation. Also, they hide what should be easily readable code inside the "point-n-click" wizards. I'd suggest just create the ADO.NET objects in code. You'll have full control over the code and avoid a MS developer's interpretation of what a user should get in a wizard.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜