views:

10

answers:

1

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.

A: 

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.

HardCode