I have just added a SQL Server database to an existing ASP.NET 4.8 Web Application website based on VB.NET. In the past, with another website, I made use of Linq-to-SQL to access a database, but the Entity Framework now appears to be the preferred solution. My next step was therefore to add the VB.NET version of the ADO.NET Entity Data Model to my App_Code folder, using the name SRMSEntityDataModel.
Via the Wizard, I chose EF version 6.x and the model contents option of 'EF Designer from database', selected the connection string for my database, chose to save connection settings in Web.Config as SRMSDBEntities, specified the tables I wanted to include and specified a model namespace of SRMSDBModel.
All went well as far as I could see. No error messages were generated and my tables all appeared on the SRMSEntityDataModel.edmx diagram.
My problem is that when I added the following line of code to one of my VB code pages, I was told that SRMSDBEntities is not defined.
Using myEntities As New SRMSDBEntities()
I'm guessing this is a namespace issue but I have failed to find a solution. Adding 'Imports SRMSEntityDataModel' or 'Imports SRMSDBModel' to the top of the VB page simply generates another error message indicating that neither of these namespaces contains any public member or cannot be found.
Any assistance would be much appreciated.