Windows Develop Bookmark and Share   
 index > Windows Forms Designer > Controls Disappeared from my Forms
 

Controls Disappeared from my Forms

Hi Everyone,

I'm working in VS2008 and had nearly completed a project for work.

I opened the dataset in design view and adjusted a query that I used to fill a table, after doing so my code threw a ton of errors and all the forms seemed to lose their association with that table adapter. I then opened a couple of the forms to see what was actually going on and they appeared blank.

After some puzzling I just removed the datatable from the dataset and then added it again which removed all the errors, however when I open my forms all the controls have disapeared, if I try and add the controls back they all get the name +1 on the end giving the impression that they still exist somewhere.(ie Companyidtextbox now gets added as companyidtextbox1 if I drag it from the datasource).

I also rather stupidly while having this error decided that i'd ignore the designer warning and open those forms and just drag the table adapter back onto them, these appear to be the ones that are blank.

All the code and events for the forms still exist but the layout in design view has totally gone, I dont mind recreating the forms but if there is an easy way to get the design back it would save me alot of time.

Regards


Marc Fielding
MarcFielding  Monday, May 19, 2008 11:38 AM

Hi MarcFielding,

Sorry, I cannot reproduce your problem using the TableAdapter Configuration Wizard (right click on the table in the typed DataSet and choose Configure). Actually, I didn’t get any error when adding or remove some columns from the data table and build the project (running the application may get some errors since you may remove some row from that data table).

Since you got some errors when you change the typed DataSet, you may change the name of the TableAdapter or the Table, please make sure to use the same name after you change the typed DataSet.

Let me know if this helps, if not, could you please provide more detailed steps to reproduce the problem? A simple project would be helpful.

Best regards.
Rong-Chun Zhang

Windows Forms General FAQs
Windows Forms Data Controls and Databinding FAQs

Rong-Chun Zhang  Thursday, May 22, 2008 6:57 AM

For some reason I can't reproduce this problem all the time, it seems to mainly occur when you mess up an SQL Statement, here's what I did:

Open the .xsd using the designer

right click Fill, Getdata()

Click Configure

change the sql, I added in DATEPART(Month, Activedate)=DATEPART(Month, GETDATE())

I didnt propogate changes to the rest of the project.

Then ended up with the problem I described above.

I definately didnt change anything other than the SQL.

Infact i've just reproduced the error exactly by deliberately messing up the SQL, I did:

SELECT CompanyID, CompanyName, Address1, Address2, Address3, Address4, Address5, Postcode, Telephone, Fax, Website, Source, Marketer, Manager, Rep, Activemonth FROM dbo.Companies WHERE

DATEPART(Month, Activedate)=DATEPART(Month, GETDATE()<------------------------------------ Missing a )

The designer throws a warning saying to sql is incorrect then closes the sql window then if I click elsewhere in my project, ie one of the forms or any other part loads of errors start coming up in the error window such as:

Error1'CompaniesTableAdapter' is not a member of 'DataSetTableAdapters.TableAdapterManager'. Dialog2.Designer.vb4039

Even if I change the sql back to what it should be these errors remain and I end up with exactly the same problem, fortunately this time i'd backed up my project before doing it!

Hopefully this helps.

Cheers

Marc


MarcFielding  Thursday, May 22, 2008 10:15 AM

Hello,

Anyone still here?!

MarcFielding  Monday, June 02, 2008 10:02 AM

Since it seems i've been abandoned I thought i'd share my solution with you.

Firstly if you edit the sql in the dataset designer for any of your tables make sure you back up your project before doing so as it seems that you are 90% screwed if it messes up.

If you do find yourself in a similar position you can try selecting "clean" from the build menu and then rebuild the entire solution, note its the Clean/Rebuild options on the bottom half of the build menu.

I've found this sometimes fixes this problem and will also fix your project when you cant seem to change the deploy path or when your changes wont publish themselves!

Cheers

Marc Fielding

MarcFielding  Friday, June 06, 2008 10:37 AM

You can use google to search for other answers

Custom Search

More Threads

• TypeCodeDomSerializer does not create override function
• Small cliclkable tooltip
• <URGENT> Calling a parent form method from a child user control
• system tray drag and drop
• Property overide sets default property value to overided value.
• How to add a Control to a ListBox ?
• How do they make these kind of Interfaces?
• problem wid datagridcolumnstyle ... urgent
• Not able to Override text property of label in derived class
• Custom panel not refreshing properly in designer