0

Visual Studio - C# The problem lies when I click on the Data Source dropdown menu in Properties - bindingSource; it throws an error message.

Error message pop-up: Object reference not set to an instance of an object.

enter image description here

When I create the Object Data Source, it doesn't appear in the DataSources folder in solution explorer either.

No new data source file appears in the DataSources folder

I'm relatively new to coding; everything seems fine, so I am trying to understand why it will not work. I was expecting it to work, and it would auto-generate a data source file. Please help.

Edit: Solution/Project isn't on test when error message fires and it doesn't throw an exception or show an error in Error List for the entire solution.

Jiale Xue - MSFT
  • 3,560
  • 1
  • 6
  • 21
  • https://i.stack.imgur.com/qR6bW.png Your problem doesn't appear when I pull down, your picture is blurry and it's hard for me to discern the information. See [bingsource](https://learn.microsoft.com/en-us/dotnet/desktop/winforms/controls/bindingsource-component?view=netframeworkdesktop-4.8) how to use the component. This is how to add data source [Tutorial](https://learn.microsoft.com/en-us/visualstudio/data-tools/add-new-data-sources?view=vs-2022) . – Jiale Xue - MSFT Mar 02 '23 at 07:39
  • https://stackoverflow.com/q/779091/16764901 In my case, I cannot reproduce your error. Please let me know if you solve the problem from my information. I'll edit this as an answer. – Jiale Xue - MSFT Mar 02 '23 at 07:54
  • Just a wild guess. What type of project is this? Does it target .NET Framework, or .NET 5 (or above?) The Data Source window is only supported for .NET Framework projects. Could it be you tried to change the target platform at some point? – Luc Morin Apr 14 '23 at 07:30

0 Answers0