Database Explorer does not show database and table - asp.net-mvc-3

I am a beginner to ASP .net MVC 3. I installed visual web developer 2010 Express. I am learning from online videos. I created a sports project and created all the models as mentioned in the video. But When I switch to Database Explorer I am not able to see the created database where in video It shows the tables. I tried to open a database connection from database explorer but at that it shows that .mdb file is already open. How can I see automatically created database tables in Database explorer?

You need to open the database it won't be added there automatically. If it's already open then maybe you opened it with access or any other 3rd party tool? Just pick a correct provider and open the file. That works for me...

Related

Advice on creating a local instance of Azure Website

I have, I admit, done things the wrong way round and created an Umbraco installation on Azure, developed multiple websites on that installation and only just decided I want a local instance for further development purposes.
Given that that's where I am, does anyone have any advice for how to go about achieving this? I have tried installing Visual Studio Community 2017 and MS SQL Server 2017 Developer and while I can connect to Azure with Visual Studio I don't seem to be able to work out how to view the installation, much less copy it down to my PC (something which I my searches seem to suggest isn't possible with Visual Studio).
I think you will need to copy down the site via FTP and the database using SQL Server Management Tools (assuming you are using SQL Server and not SQL CE).
You can get the FTP connection information from the Azure portal. The web root is in /site/wwwroot. Copy it down locally and you will be able to open it in Visual Studio as a Web Site. For the database, you can connect to the Azure SQL database with SQL Server Management Tools (you should have the connection info from when you created the database) and then right click on the database, select "Tasks" > "Export Data-tier application..." which will allow you to save a 'bacpac' file your local machine. You can then connect to your local SQL Server instance, and then right click on the "Databases" node in the Object Explorer and select "Import Data-tier application..." Once the database is imported, you may need to create/update a SQL Server user and grant it access to the database you just imported. For local development I just set the user to be owner of the the db. Back in Visual Studio, you should update the "umbracoDbDSN" connection string to use the new local database. At this point you should be able to run the website locally.

Using Oracle Developer Tools with Source Control for Visual Studio

I'm a bit lost in implmementing/using tfs version control with Oracle products. The project I'm on is using visual studio 2012, tfs 2013, an oracle 11g server, a few copies of Oracle SQL Developer, and a few copies of toad.
I was recently looking for a way to do tfs version control through visual studio using oracle developer tools*. Is this a viable approach?
When tooling around with it, I've been able to create a database project with tables, procs, etc and put this under tfs version control. I've also been able to run these procs against my normal database server. However, I have not been able to put my existing database under version control. I have also not been able to run my code against the visual studio database project.
So can tfs be used with oracle developer tools to provide a version control solution?
Alternatively, are there any ways to integrate tfs version control with both Oracle SQL develoeper and toad?
*Oracle Developer Tools - http://www.oracle.com/technetwork/developer-tools/visual-studio/overview/index-097110.html
On the oracle developer tools promo page it says
"SQL Script Lifecycle with Source Control Integration: Generate SQL
scripts for Oracle schema objects that your .NET application uses,
manage them in an Oracle Database Project, check them into source
control, edit the scripts in the Oracle SQL Editor, and execute them
with a built in SQL*Plus execution engine."
How does this work? Can I automatically generate the scripts each night and check them in or something?
Yes, after you install Oracle Developer Tools for Visual Studio, you can configure your Oracle Data Connections in the Server Explorer, create a new Oracle Database Project, then drag and drop packages or other items from the Server Explorer to your new project. Then, after editing the .sql files that were generated, you can right-click on the .sql files generated and "Run" or "Run on...". Finally, you can also run subsets of each script by right-clicking on a selection and choosing "Run selection".
You still need the discipline to ensure everyone edits packages via source control and not on the database directly.
SSDT database projects in Visual Studio only support SQL Server.
One option is to try Red Gate Source Control for Oracle, a tool developed by the company I work for. This supports both TFS and Subversion. I'd be interested to know if this is something that might work for you.
You can use Toad to integrate Microsoft TFS changes. Please see : http://www.toadworld.com/products/toad-for-oracle/m/media-library/689.aspx

Reload database objects in a VS database project?

if I create a SQL Server 2008 Database Project in Visual Studio 2010, then I am able to right click the project and select Import Database Objects and Settings.... I can do that exactly one time (even if I get an error while importing). If I did it one time, the option is grayed-out.
But after I have imported my objects, I couldn't find a way to reload or refresh the objects. A good example would be, that I have a database project of a whole database and someone adds something to the database directly. Now I want to have new table (function, procedure, etc.) in my project, too.
There has to be a better way than copy&paste to add new existing database objects to my database project?
I found this question:
Script all SQL database objects into VS Database project
But I neither have a Schema Compare option, nor can I drag&drop files from the server explorer.
In Visual Studio you should see a menu choice that says Data. If you click on that, you should be able to run a Schema Compare. If you're not seeing that, then there's something wrong with your VS install or the project or maybe both.

Publishing a SQL Server Database project

I've created a SQL Server database project that correctly deploys a database on my machine. However, I need this project to create databases on QA's machine. They do not know how to create a database from a script.
Is there a way a database project in Visual Studio 2010 can be published so all a non-technical user has to do is click an executable and the database will automatically install?
What you are looking for is this MSDN article: Deploying a Database by Using the Database Publishing Wizard.

Error opening the .mdf file to app_data

I am not able to add .mdf file in App_data(vs 2010 visual studio).
If I right click on App_data and try to add existing item and select mydatabase.mdf and click OK I am getting this error:
The file can not be opened because it is used by another process.Please close all applications that might access this file and try again.
But I am just running visual studio.
Not sure if you have found a solution for this, but I just ran into the same problem. I found some relevant info here:
How to add a new database under app_data with SQL Server Enterprise Edition
From this I gather that adding new AND existing databases (ie the .mdf file) via VS2010 is not possible.
I'm assuming (for this answer) that your end goal was the same as mine, i.e. to use the Microsoft Entity Framework to generate a model class from the database.
As I didn't want to install SQL express just to do this my solution was:
-Create any new db via SQL Server 2008 MGMT studio (or a script if you are that way inclined).
-Add a CONNECTION to the database in VS2010
-When adding a new model using the 'Entity Data Model Wizard' select 'Generate from database' and then select your existing connection, and the relevant table(s).
Worked for me!

Resources