Click here to Skip to main content
15,904,155 members
Please Sign up or sign in to vote.
1.31/5 (4 votes)
See more:
Hi,

I want create Database and table in SQL using Visual Studio 2010, C#.
I want create through Program. It is possible. If it is possible, Please guide Me.

Thanks in advance.
Posted

Yes you can.
SQL provides statements to create new databases and database objects. You can execute these statements from your program to create databases programmatically.

Below article, you can see how to create a new SQL Server database and its objects such as table, stored procedures, views and add and view data. you also can see how to change database table schema programmatically. You'll see how SQL statement ALTER TABLE is useful when you need to change a database table schema programmatically.

Create a SQL Server Database dynamically in C#

I hope this will help to you.
 
Share this answer
 
 
Share this answer
 
Comments
Vijaydhas 10-Oct-13 10:20am    
Thank you for instant reply. But there no solution for creating DB from Visual Studio? I want create from Visual Studio. Is it possible?
Eduard Keilholz 10-Oct-13 13:51pm    
What? You thought I'd create a solution for you?
Vijaydhas 11-Oct-13 11:51am    
No no.. Not like that. Just need an ideas, Past demo links only..

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