Code generated by the Data controls disappears

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
 
C

Cor Ligthert

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
 
M

Miha Markic [MVP C#]

Hi dan,

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

dan

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top