I am new to Visual Studio and I am trying to build a data entry form for my SQL database table but I keep getting an error I dont understand

Sounds like someone was playing around in the Form1.designer.cs file. That’s a no no. The designer files are reserved for the exclusive use the Visual Studio forms designer, and you should not touch them.

But maybe I’m a little too harsh. Since the move to Core, the Winforms system hasn’t been quite as, let’s say “robust”… as it once was, and this kind of thing seems to happen on it’s own from time to time now 😔

To fix it, you’ll need to remove the method and all references to it from your code. Then use the Visual Studio designer to re-add it.

This demonstrates (one reason) why it’s important to have source control, even for small personal projects. Visual Studio will need to do it’s thing to re-add the method (reverting doesn’t always help), but having source control gives you the body of the method and tells you where calls to it are made, so you can recover effectively.

Read more here: Source link