How To Save New Table To Service Based Database In Visual Studio
Sample can be downloaded from -
Create a Service-based Database file in Visual Studio for proof of concept and demo projects
Pre-requisites –
To achieve this, SQL Server information tools must exist installed for Visual Studio.
Steps to Create a Sample Database –
ane) Open up Visual Studio –
2) Create an empty solution.
three) Add a Class Library projection.
4) Delete the default Class1.cs (or vb) file.
5) Right click on the projection and add New item…
6) Choose "Service-based Database" from the list.
7) A new MDF file gets created. In this example lets rename this file equally CustomerDatabase.mdf
8) Click on Add button to add together the file to the solution.
9) To access the database from menu View à Server Explorer (Ctrl+Alt+S)
ten) This will open the Server Explorer window. In this window aggrandize "Information Connections".
11) This list will have the newly created database. Expand this to see the database objects folder grouping.
12) Right click on tabular array and Cull Add New Table.
13) This volition open the Create tabular array UI blueprint window. Forth with associated T-SQL to exist bottom. UI key constraints are available on the correct pane.
14) Specify the new table name in the T-SQL window. The column names and database tin exist specified either in UI or in DDL statement in T-SQL. (The UI will not be different from standard SQL Server Management studio except the database is local on Visual Studio)
xv) Click on Update button on the top column list. This will display the Preview Database Updates window. Click on Update Database push button to commit the changes to database.
16) Refresh the Serve explorer window Tables Folder to view the newly created table.
eighteen) To make a column as identity column –
a) Open the table in design mode (double click on the table)
b) Choose column properties.
c) Make Identity specification to True
d) Identity Increment to ane (increment interval)
e) Identity Seed to 1 (starting value)
nineteen) Click on Update button and Update database to commit the changes to database.
How To Save New Table To Service Based Database In Visual Studio,
Source: https://www.linkedin.com/pulse/service-based-database-file-visual-studio-bharath-gunupati
Posted by: norristimentep.blogspot.com
0 Response to "How To Save New Table To Service Based Database In Visual Studio"
Post a Comment