Having a few issues with some DB functions in my code at the moment. This code was developed by another user who kindly helped me out, and I know for sure it was working. The difference being that after having some compatability issues when upgrading to a new version of VS, I decided to create a new project from scratch and basically type the whole lot out again.
Whilst this fixed the issues I was having previously, it seemed to introduce some issues on the DB side.
As far as I can see (and my eyes are now sore through checking!) it is all correct, but I am wondering if someone can maybe spot something that I am not seeing.
So, the issues that I am getting is within the function to drop the database. I get an error saying that the database is in use (yet the same code worked perfectly previously)
Also, when using the Test Data Insert function, the Schedule data is failing with a SQL Exception error relating to scalar declaration. Again this worked fine previously.
Screenshot for the Insert Data Error below, and I have also attached the solution.