Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > How can I avoid having my form trashed by making changes to a table adapter ?
 

How can I avoid having my form trashed by making changes to a table adapter ?

Hi;

I thought that I would try and utilize the auto generated code in Visual Studio 2005 and so I designed an app this way.

It works great with the exception of one thing.

After the app has been created, and I let's say I add a relationship between tables through the TABLEADAPTER.

When I try to run my app or even look at my form now I get a page chocked full of error messages.

Am I failing to do something prior to rebuilding my app after I have made changes ?

Thanks for any insights,

GeeMann

GeeMann  Friday, August 03, 2007 6:23 PM

Hi, GeeMann,

Could you please show us some of the errors and tell us some details of what have you done to the TableAdapter?

Regards

Yu Guo â€?MSFT  Monday, August 06, 2007 7:29 AM

Hi ;

I hope this better explains my problem.

I clicked on the "smart" button on the dataAdapter.

Next I choose the "edit queries in the dataset designer".

Then I right-clicked the dataadapter associated with the table and went into properties.

FInally I changed a property and then exited out of the TableAdpater and rebuilt and executed the App again.

Now instead of being able to edit the form I get a screen full of error messages.

For instance :

The variable 'Branch_CodesBindingSource' is either undeclared or was never assigned.
Hide

at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.Error(IDesignerSerializationManager manager, String exceptionText, String helpLink)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeExpression(IDesignerSerializationManager manager, String name, CodeExpression expression)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeAssignStatement(IDesignerSerializationManager manager, CodeAssignStatement statement)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeStatement(IDesignerSerializationManager manager, CodeStatement statement)
There are several of these errors now.
It's like the Property changes I made were never written to the desinger file ?
Hope this helps your understanding.
Later,
Geemann

GeeMann  Monday, August 06, 2007 4:18 PM
GeeMann  Monday, August 06, 2007 8:08 PM

Hi All;

I solved my problem but don't understand how this corrected my problem.

But I had commented several lines in my BindingNavigatorDeleteItem event handler.

When I uncommented the lines and then rebuilt my App the error messages disapperred !

So is there some bug that doesn't make changes to the vb file behind your controls the[MYForm.vb[Design] when

you change your MyForm.vb?

Hope someone knows the answewr.

Later,

Geemann

GeeMann  Monday, August 06, 2007 8:33 PM

Hi, GeeMann,

I cannot reproduce your problem, but it seems that what you have done may damage the CodesBindingSource object.

Please post some codes in your designer.vb if possible.

And have you applied the service pack?

http://www.microsoft.com/downloads/details.aspx?FamilyId=BB4A75AB-E2D4-4C96-B39D-37BAF6B5B1DC

Does this problem exist in your other projects?

Regards

Yu Guo â€?MSFT  Tuesday, August 07, 2007 2:27 AM

We are changing the issue type to “Comment�because you have not followed up with the necessary information. If you have more time to look at the issue and provide more information, please feel free to change the issue type back to “Question�by editing your initial post and changing the radio button at the top of the post editor window. If the issue is resolved, we will appreciate it if you can share the solution so that the answer can be found and used by other community members having similar questions.
Thank you!
Yu Guo â€?MSFT  Friday, August 10, 2007 6:52 AM
This just happened to me. Every form using a particular dataset has gone into error, i changed the datatype in the SQL server, then tried to update the tableadapter to reflect the change by running the configuration manager... It did not like that.
MJoseph1982  Tuesday, September 22, 2009 10:38 PM

You can use google to search for other answers

Custom Search

More Threads

• Custom Object in DataGrid
• Edit mode for DataGrid
• Popualting Combo Box
• Datagridview selection problem
• DataGridView - Moving around with Enter/Tab/Arrows
• Controlling Scrolling
• Get row ID of the BindingSource's added Row
• Data binding, INotifyPropertyChanged, and Deserializing without raising propertyChanged
• DataGridView, partly bound and partly unbound
• DataGridViewColumn.Format