如何执行MS SQL服务器查询? [英] how to execute Query whit out MS SQL server ?

查看:65
本文介绍了如何执行MS SQL服务器查询?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在构建一个Windows窗体应用程序,其中有一个2外部查询,当我点击我的WinApp Button1执行并创建新数据库然后当我点击Button2时,另一个查询改变了数据库如(插入,更新,删除)

无需打开MS SQL

我尝试一切,甚至尝试批处理文件来运行查询但没有打开MS SQL Server,很遗憾没有发生任何事情!

帮助我。

谢谢。

Hi I'm building a windows form application wherein it there is a 2 external Query and wanna when I click on my WinApp Button1 execute and create new database and then when i click on Button2 an other Query alter that database like (insert, Update,Delete)
without opening MS SQL
I try every thing , even try batch file to run Queries but without opening MS SQL Server, Unfortunately nothing happened!
Help me.
Thanks.

推荐答案

如果你是正在创建一个带有嵌入式数据库的应用程序[ ^ ]不使用SQL:尝试SQLLite:[ ^ ]。
If what you are after is creating an application with an embedded database [^] that does not use SQL: try SQLLite: [^].
"SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. SQLite is the most widely deployed SQL database engine in the world. The source code for SQLite is in the public domain."

这里有一个SQLLite的.NET实现:[ ^ ];另一个(ADO.NET提供者)这里[ ^ ];另一个在这里[ ^ ]。



搜索CodeProject的SQLLite文章,和你一起我会找到使用这些的教程。

There is one .NET implementation of SQLLite here: [^]; another one (ADO.NET provider) here [^]; another one here [^].

Search CodeProject for "SQLLite" articles, and you'll find tutorials for using these.


请阅读我的评论。



如果说open ms sql server你的意思是打开MS SQL Server Management Studio,你错了。当你是数据库程序员时,你需要知道能够创建新数据库并制作 CRUD操作 [ ^ ],你需要连接到sql server [ ^ ]。您不必打开ms sql server,因为它已经在运行(它是Windows服务并在Windows操作系统启动时启动)。



可以通过 SqlClient [ ^ ]对象和方法。只有在拥有管理员权限的情况下,才能执行某些指令,例如create database。
Please, read my comment.

If by saying "open ms sql server" you mean open MS SQL Server Management Studio, you're wrong. When you're database programmer, you need to know that to be able to create new database and make CRUD operations[^] on it, you need to connect to sql server[^]. You don't have to open ms sql server, because it's already running (it's windows service and starts when Windows operating system starts).

The connection to ms sql server is possible via SqlClient[^] objects and methods. Some instructions, like create database would be possible to execute only in case when you have admin privileges.


这篇关于如何执行MS SQL服务器查询?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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