0

I know this has been asked before, but I've looked around and I can't find anything that quite matches what my problem is, so apologies for the dupe post.

I am writing a .NET #.5 app in C# that uses an internal SqlCE DB. Whenever I run the app in the debugger, I get the error listed in the title on the BindingSource line below:

this.Load += new System.EventHandler(this.Main_Load);
((System.ComponentModel.ISupportInitialize)(this.dbCDRDataSet1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.animalControlBindingSource)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();

This is in the Designer.cs portion of my main form (Main.Designer.cs). If I comment out the code, it all seems to work perfectly, but since it's autogen code, it pops back up every time.

Some background on the DB structure:

My database is dbCDR.sdf. I have one dataset, dbCDEDataSet1.xsd, which contains all tables. One of the tables is called AnimalControl.

If I try to rewrite the offending line, Intellisense gives me the same result the autogen code does.

I have tried deleting and recreating the dataset (with the same name) a few times, just to see if it will force a more complete refresh.

I can give any more details as needed, just let me know. Thanks so much!

pmbasehore
  • 57
  • 1
  • 10
  • Have you looked at: http://stackoverflow.com/questions/17170549/datamember-property-system-cannot-be-found-on-the-datasource ? – Hylaean Jul 23 '14 at 13:14
  • @Hylaean I did, but it didn't look like the same error. I'm not using any controls tied to the datasource, it's all done internally via SqlCeDataReader, etc. I can attach that part of the code if it will help. – pmbasehore Jul 23 '14 at 13:26
  • Can you post the Exception with its stack trace? – Hylaean Jul 23 '14 at 13:28
  • The trace is too long to fit in a comment, so here's a [PasteBin link](http://pastebin.com/V17uhiL5). – pmbasehore Jul 23 '14 at 13:39
  • In animalControlBindingSource you need to set the name of the source as "AnimalControl" if it is its proper name not the name with the space you used. – Hylaean Jul 23 '14 at 13:44
  • That was it, @Hylaean. I hate "answering" my own question, so if you want to submit that as an answer, I'll mark it! – pmbasehore Jul 23 '14 at 13:53
  • I am not a fan or this either, but sure. Thankx. – Hylaean Jul 23 '14 at 14:02

2 Answers2

0

I found it! Sorry to waste your time.

The Stack Trace had the table name as "Animal Control" (with a space). I overlooked that when I saw it the first time.

Dunno how that got there, but I found the offending bit of code in the Designer.cs code and changed it. Now it's happy.

Thanks, @Hylaean, for forcing me to look over my Stack Trace more carefully! :-)

pmbasehore
  • 57
  • 1
  • 10
0

In animalControlBindingSource you need to set the name of the source as "AnimalControl" if it is its proper name not the name with the space you used.

Should be in designer file somewhere.

Hylaean
  • 1,237
  • 13
  • 19