Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi how can i
Creating a SQL Server Database with 2 related table =====Programmatically (runtime)

please attach a simple project(asp.net+c#+sqlexpress)
best regard
Posted

You can do this for example by executing SQL statement using a SqlCommand[^]

The SQL statements, you would need:
- CREATE DATABASE[^]
- CRETE TABLE[^]

The CREATE TABLE command contains keywords to create the foreign key between tables.
 
Share this answer
 
please attach a simple project(asp.net+c#+sqlexpress)
Any other service please?

It does not work like this here.

Here is what is expected of enquirers:
1. TRY first what you want to do! You may find that it's not that hard.
2. Formulate what was done by you that looks like an issue/not working.

Try them and tell if you face issues.
Members will be more than happy to help like this.



For now, Creating a SQL Server Database with 2 related table =====Programmatically (runtime)
Start from here: Video: C# database - create database and add the simplest table[^]
 
Share this answer
 
Comments
azeran 26-May-12 2:52am    
hi thanks
this video not usfull for me
i need to create database and their tables Programmatically
not by use sqlmanager
azeran 26-May-12 2:56am    
like this

http://www.codeproject.com/Questions/392063/Creating-a-SQL-Server-Database-Programmatically

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900