Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2012 adding a database and creating first table named users

I have Visual Studio 2012 Express and have a razor c#.net project set up.

I have right clicked on AppData and added a Microsoft SQL database and named it "EspressoCoffees"

Now I can see that it is there, I goto the Database Explorer and right click on Tables and click add table.

The table designer comes up and I make a few columns making sure "Id" remains primary key.

  1. Where on earth do I name the table? There is a table properties panel which I can't edit the name in as it is greyed out?
  2. When I save the table it makes me choose the location for the file, what file is this? The table or the database???
  3. If I save the SQL file in the app data part... It doesn't appear under the Tables folder any way.
like image 478
Jimmyt1988 Avatar asked Jan 29 '13 19:01

Jimmyt1988


People also ask

How do I add a table to Visual Studio database?

Right-click on Tables and select Add New Table. The Table Designer opens and shows a grid with one default row, which represents a single column in the table that you're creating. By adding rows to the grid, you'll add columns in the table. Right-click on the CustomerID row, and then select Set Primary Key.

How do you create a database user?

Expand the database in which to create the new database user. Right-click the Security folder, point to New, and select User.... In the Database User - New dialog box, on the General page, select one of the following user types from the User type list: SQL user with login.


1 Answers

Just modify the name of the table in the generated T-SQL and click on the "Update" button (int the top-left corner of the tab).

enter image description here

like image 71
josemiguel.torres Avatar answered Sep 28 '22 07:09

josemiguel.torres