Code generated by the Data controls disappears

  • Thread starter Thread starter dan
  • Start date Start date
D

dan

The code generated by the Data controls such as SqlDataAdapter and
SqlCommand disappears when a change is made to the form (e.g. changing the
text of a control, adding a new button, etc). Thus the data controls must
be reconfigured which is highly annoying.

Does this work as designed, is it a VS fault or am I doing something wrong?
Is there a way to avoid this happening?

Thanks,
Dan
 
Dan,

Changing any object showed in the designer should (as it works as it has to
be) not affect any other object.

Try it with a new project, sometimes when you change something in the
designer generated code or delete a dataset or something you gets this kind
of behaviour you are telling now.

I hope this helps?

Cor
 
Hi dan,

Maybe you have another error on the form which causes code dissapearance?
What does Task List window say?
 
Hi Miha,
There is no other error, the programs compiles ok. Actualli it was during
execution that I realised that the behaviour changed.
Thanks, Dan



Miha Markic said:
Hi dan,

Maybe you have another error on the form which causes code dissapearance?
What does Task List window say?

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

dan said:
The code generated by the Data controls such as SqlDataAdapter and
SqlCommand disappears when a change is made to the form (e.g. changing the
text of a control, adding a new button, etc). Thus the data controls must
be reconfigured which is highly annoying.

Does this work as designed, is it a VS fault or am I doing something
wrong?
Is there a way to avoid this happening?

Thanks,
Dan
 
Back
Top