我们可以使用C#从visual studio创建SQL Server数据库。 [英] can we create SQL Server database, Table from visual studio using C#.

查看:107
本文介绍了我们可以使用C#从visual studio创建SQL Server数据库。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我希望使用Visual Studio 2010,C#在SQL中创建数据库和表格。

我想通过程序创建。有可能的。如果有可能,请指导我。



提前致谢。

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.

推荐答案

是你可以。

SQL提供了创建新数据库和数据库对象的语句。您可以从程序中执行这些语句以编程方式创建数据库。



在下面的文章中,您可以看到如何创建新的SQL Server数据库及其对象,如表,存储过程,视图以及添加和查看数据。您还可以看到如何以编程方式更改数据库表模式。当您需要以编程方式更改数据库表模式时,您将看到SQL语句ALTER TABLE是如何有用的。



动态创建SQL Server数据库在C#



我希望这会对你有所帮助。
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.


可能



指南1 http://technet.microsoft.com/en-us /library/ms176061.aspx [ ^ ]

和指南2 http://www.sqlcourse.com/create.html [ ^ ]


这篇关于我们可以使用C#从visual studio创建SQL Server数据库。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆