Visual Studio: The system cannot find the path specified - asp.net-mvc

I am developing a website in ASP.NET MVC in Visual Studio. I'm trying to add a Database connection, but it gives me the error "The system cannot find the path specified".
Here's what I am doing:
Right Click on Models Folder
New Item > ADO.NET Entity Data Model
EF Designer from Database
New Connection (SQL Database connection test succeeds)
Choose the tables I want to include
Press Finish
Error Appears
The Output Window says the following:
Generated model file: Model1.edmx.
Loading metadata from the database took 00:00:01.3576925.
Generating the model took 00:00:01.3134936.
However, the Models Folder is empty and no connection strings are made. I have been trying for about an hour and nothing, deleted the .vs, bin, and obj folders, rebuilt the solution but nothing works. I appreciate any help you can provide.

After much troubleshooting, I managed to fix the issue, details below:
Delete Models folder (backup any files inside)
Create a new empty Models folder
Add the new Model
Hope this helps anyone with this issue.

Related

Intellisense namespace discovery in Visual Studio not working after moving files to another project

I started with a single ASP.Net MVC project named Yogabandy2017 that had a folder called viewmodels. I stored all the viewmodels in it.
I moved all the files from that folder to another project called Yogabandy2017.Models where I stored all my models and I created a folder in it called Viewmodels where I put all the viewmodels, I also changed the namespacing in each of the viewmodels to match.
Then I did a large copy and 'replace all' in each view so that each view can now point to the correct folder like this
from this
to this, where I added the .Models to make the path correct
But intellisense still hasn't changed and picked up the correct path. I've tried to clean the solution, rebiuild it a couple of times. and still the path isn't connecting correctly. I still have the red underline and an exception being thrown when traversing the page saying it can't find the path.
Is there any way to get these paths to reset without going to each file and rewritting them manually? I have a few hundred and going through each one by one to make the change will take forever.
Any help would be appreciated...
Check your cases...
YogaBandy2017
vs.
Yogabandy2017

How can I view the Tables structure in sqlite Manager add-on on Firefox?

I am creating a Database called Reminder.sqlite via Sqlite Manager add-on in firefox, after creating I am importing it to my iOS Application, the problem is that records are saved in database table but when I run a Select query in Sqlite manager no records are displayed any suggestions why this is happening?
make sure you have add database file into project and remove database file from document directory.
because old file is exist in document director, your new file with same name cannot be overwrite old one.(according to approach, if we use in code)
It may help you.

No such table Sqlite error iOS

I am working with sqlite in iOS app. I have created login and register screens and tables successfully. Now, I am creating another table to save data. The table has been created but when I run the query to insert values, I get following error --- "no such table: proposalInfo". Can somebody help me in this ?
If you created database on terminal, then the problem is likely how you got the database you accessed from the terminal to your iOS device. Usually you would include it in the bundle (and make sure you have a checkmark against the appropriate target), and then you'd have code that looks for the database in “Application Support” directory, and if it does not find it, copy it from bundle to there. (Note, in the past, we would have recommended the “Documents” folder, but nowadays that is for user-facing files; we use “Application Support” directory nowadays for files used internally within the app.) The typical problem is simple bug in that logic (perhaps in previous iteration of development), which failed to copy it properly and then subsequently called sqlite3_open which created blank database.
Likely, somewhere in this process, there was insufficient error detection/reporting, so some error went undetected and blank database was created. So, I would recommend:
remove app from device (to get rid of any blank database in “Application Support” folder, if any);
double check error detection/reporting (e.g. check all NSFileManager method return codes and NSError objects);
do not use sqlite3_open, but rather use sqlite3_open_v2 so that it will never create blank database (namely, with SQLITE_OPEN_READWRITE option, but not SQLITE_OPEN_CREATE); and
run app again and see if you can identify where in the process it went awry.
By the way, if you do not believe us that the table is really missing from the database, I would suggest you open the simulator’s database from macOS SQLite tool, and simply confirm. So
navigate to the simulator’s “Application Support” folder:
~/Library/Developer/CoreSimulator/Devices/[GUID]/data/Containers/Data/Application/[GUID]/Library/Application Support
And
Open that database in your SQLite terminal interface, and confirm existence or absence of the table in question.
Please create table using SQLite browser. Which is you can download from here.
Then follow below step
1) Open your project db by clicking.
2) Create table Query or using UI.
3) Execute query whatever you want.

Saving a sql file after creating a Controller?

Visual Studio wants me to save a sql file dbo.Table.sql after I create a Controller for the model that represents the table in my database. The tutorials and documentation that I find online do not mention this at all.
http://www.w3schools.com/aspnet/mvc_models.asp
http://www.asp.net/mvc/overview/getting-started/database-first-development/generating-views
So it opens up a safe dialogue after I specified the Model and Context and press add on the Add Controller dialogue. The path starts in my Documents folder but I am not sure where to safe this, I would logically place this in App_Data.
So why does it ask me to safe the sql file?
And where do I need to store it?
And perhaps, why is this not mentioned in the documentation? I'm pretty sure I am doing it in the same manner. Create SQL Server -> Add tables -> Add Model -> Add MVC5 Controller with views using Entity Framework
The answer is simple, I had a typo in my Model class so it did not find the table, you can see it in the screenshot. If you ask me it would be better to throw a warning when adding a controller that does not have a correctly mapped table and give the option to create a local script file for it. On the other hand, now I know this it's probably obvious.

Asp.net MVC, adding edmx gives trusted zone warning

I have an ASP.net MVC 4 project I am working on and am trying to add an ADO.net EF model to it using Database First.
The creation of the model (.edmx file) seems to run successfully and I am left with the desired .edmx model file in the folder I specified. However, I don't appear to be able to see any of the files nested under this model. (From all my research, I should be able to expand the .edmx file and see *Context.vb, *Designer.vb, *.edmx.diagram and *.tt files underneath, but I cannot.)
It should look something like this in the msdn article about Database First (see Step 4):
Upon noticing this issue, I discovered a handful of warnings that appeared after creating the .edmx model, one of which is (I have obscured part of the full path):
The path 'P:\IT\...\DAL\EF.Utility.VB.ttinclude' must be either local to this computer or part of your trusted zone. If you have downloaded this template, you may need to 'Unblock' it using the properties page for the template file in File Explorer.
The project is stored on a network share on one of our servers so it can be included in our daily backups and Windows Shadow copy also. My understanding is that the above warning has appeared because of this and I need to set my machine to trust this location.
I have tried all possible variations I can think of of
this MSDN article
but to absolutely not success at all, the warning remains.
Either I am looking in the wrong place, or I have missed something.
Does anyone know what I can do to remove this warning and gain access to the objects nested below the .edmx model?
Perhaps this could be of some assistance. I've never really dealt with trust issues working across the domain. I lean towards pulling down and working with a local copy.

Resources