如何在独立的exe应用程序中添加ms sql server数据库文件 [英] how to add ms sql server database file in stand alone exe application

查看:103
本文介绍了如何在独立的exe应用程序中添加ms sql server数据库文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在ms sql server 2008中创建数据库emp.mdf。然后我想在我的独立exe中使用这个数据库。我可以使用

i am create databse emp.mdf in ms sql server 2008 r2.then i want to use this database in my stand alone exe .how can i use

推荐答案

使用数据库创建一个可遗漏的包 -

自动安装SQL 2005 Express的.NET安装程序 [ ^ ]

在安装.NET应用程序期间创建数据库 - 版本2 [ ^ ]

部署您的应用程序on和数据库 [ ^ ]
Create a deplorable package with the database -
.NET Installer that Automatically Installs SQL 2005 Express[^]
Create database during installation of a .NET application - Version 2[^]
Deploy your Application and Database[^]


转到菜单中的数据标签 - >添加数据源 - >它将询问您要选择哪个数据库 - >点击下一步 - >选择数据集 - >它会要求连接字符串 - >点击新连接 - >点击点击向导将打开 - >选择数据源作为SQl服务器 - >然后选择服务器名称Type。如果它在你的本地机器上 - >选择验证类型 - >然后在底部看到数据库名称显示从中选择.click next->它会提示您选择哪个表格 - >选择表格 - >点击完成 - >



如果你想通过点击菜单栏中的视图来看你的桌子打开服务器资源管理器 - >服务器资源管理器 - >



让我知道是否有帮助
Go to Data tab in the menu -> Add Data Source-> it Will ask For Which database You Want to choose -> click next -> Select Dataset -> it will ask for Connection String -> Click on new connection->On Clicking A wizard will Open ->Choose datasource as SQl Server -> then choose server name Type . if its on you local machine -> choose authetication type ->Then at the bottom see the database name shows up select from that .click next-> it will prompt You to Which table to choose -> Choose the table-> click on finish ->

if you want to see your table open the server explorer from by clicking on view from menu bar -> server explorer ->

let me know if it helped


这篇关于如何在独立的exe应用程序中添加ms sql server数据库文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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