Windows Develop Bookmark and Share   
 index > Windows Forms Designer > DataMember property not found
 

DataMember property not found

I am not sure if this is the right forum but heres my problem:

I have a VB 08 frontend using a MS SQL server database as its backend. In one of the tables in the database, there was a field called PatientID which had a relation with a primary key field from another table. This field had been used only in a DataGridView. I wanted to remove the field from the database, so first I remove the DataGridView, and then deleted the field from the table. Then I saved the table and refreshed my data source to show that that field was no longer availabe. However, for some reason, it still wants that relationship object, and whenever i try to open the form, it gives me an error saying 'DataMember Property 'FK_MedicineHist_Patients' cannot be found on the DataSource. This also shows up in the error list below, however, it doesnt refer to any particular line of code. The form designer just gives me an option to show the call stack for the error, however I dont understand it. How do I find the problematic code and delete it?


Neil
skorned  Friday, January 23, 2009 9:53 PM

Hi skorned,

Do you mean you drag the table from the Server Explorer and drop it onto the Form?
If so, the TableAdapter will map the database table structure and Constraints, if you delete any column, the structure will be broken. So the Foreign key cannot be found result in the error.

If you just don't want to show that column, you can set its Visible property to false. It is not recommend to delete the key constraints column from the TableAdapter.

Sincerely,
Kira Qian


Please mark the replies as answers if they help and unmark if they don't.
Kira Qian  Tuesday, January 27, 2009 9:15 AM

Hi skorned,

Do you mean you drag the table from the Server Explorer and drop it onto the Form?
If so, the TableAdapter will map the database table structure and Constraints, if you delete any column, the structure will be broken. So the Foreign key cannot be found result in the error.

If you just don't want to show that column, you can set its Visible property to false. It is not recommend to delete the key constraints column from the TableAdapter.

Sincerely,
Kira Qian


Please mark the replies as answers if they help and unmark if they don't.
Kira Qian  Tuesday, January 27, 2009 9:15 AM

You can use google to search for other answers

Custom Search

More Threads

• Property For combobox
• Multiple Forms
• Windows form designer would not allow InitializeComponent to accept variables and arithmetic manipulations
• Progress Bar incorporating with a crystal report using vb.net 2005
• Getting the focus of Custom Controls
• ListView Scroll and Resize Column events
• getting a control to repaint when designing
• Remove Drawing Events - C#,Windows Application
• Any Difference between Form.Close and Form.Dispose?
• VS2005 IDE changes to component model breaks my code.