使用C#.net在SQL Server 2005中创建实例 [英] Creating instance in sql server 2005 using c#.net

查看:99
本文介绍了使用C#.net在SQL Server 2005中创建实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建数据库安装程序类,该类创建sql server 2005实例并创建数据库,我们该怎么做?
请帮我吗?
如何使用c#.net在sql sever 2005中创建实例?

i want to create database installer class which create instance of sql server 2005 and create database how can we do this?
plz help me?
how to create instance in sql sever 2005 using c#.net?

推荐答案

好吧,您不能使用C#代码创建SQL Server的实例" ,除非它通过Process.Start运行SQL Server安装程序.您可以编写使用连接字符串连接到SQL Server实例并运行SQL来创建和填充数据库的编码.
Well, you can''t create an ''instance'' of SQL Server with C# code, unless it runs the SQL Server installer with Process.Start. You CAN write cod ethat uses a connection string to connect to a SQL Server instance and runs SQL to create and populate your database.


您可以使用C#相当轻松地创建SQL Server CE实例,尽管与成熟的SQL Server 2005相比,它有一些局限性(例如,您无法创建存储过程).但是,如果要在一堆客户端计算机上安装数据库,则该客户端可能不需要太多的SQL功能,在这种情况下,此解决方案可能很好.如果您想了解更多信息,请在Google上搜索"SQL Server CE"(CE =精简版).
You can create a SQL Server CE instance fairly easily with C#, although it has some limitations when compared to the full blown SQL Server 2005 (e.g., you can''t create stored procedures). However, if you are installing a database on a bunch of client computers, then that client will probably not need too many SQL features, in which case this solution might be fine. If you want to know more, do some Google searches for "SQL Server CE" (CE = Compact Edition).


这篇关于使用C#.net在SQL Server 2005中创建实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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