如何将数据库与.net设置应用程序绑定? [英] How to bind database with .net setup application?

查看:84
本文介绍了如何将数据库与.net设置应用程序绑定?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用SQL Server和Visual Studio将数据库与.net设置应用程序绑定?

How to bind database with .net setup application using sql server and visual studio?

推荐答案

hai shekhar2012,

1.创建一个连接字符串为

私有con作为新的SqlConnection("Password = ******; User ID = username; Data Source = databasename; Persist Security Info = True")

2.创建一个sql命令


hai shekhar2012,

1.create a connection string as

Private con As New SqlConnection("Password=******;User ID=username;Data Source=databasename;Persist Security Info=True")

2.create a sql command


Private cmd As sqlCommand
     cmd = New sqlcommand(sqlQry, con)
            If con.State = ConnectionState.Closed Then
                con.Open()
            End If


检查本文
使用Installer类轻松部署SQL Server数据库 [ ^ ]
Check this article
Deploy SQL Server databases easily with an Installer class[^]


这篇关于如何将数据库与.net设置应用程序绑定?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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