且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将SQL Server 2008连接到Microsoft Visual Basic 2010

更新时间:2023-01-30 20:35:47

您需要创建一个 ^ ]对象,然后使用该对象.链接中有描述,以及一些涵盖常规任务(例如您所需的任务)的示例.

您可以通过在VS中查看服务器资源管理器"窗格来获取连接字符串-突出显示数据库并在属性"窗格中查找.您可以从此处复制连接字符串.
You need to create an SqlConnection [^]object, and work with that. The link has a description, and some examples that cover general tasks such as those you need.

You can get your connection string by looking at the Server Explorer pane in VS - highlight your database and look in the Properties pane. You can copy the connection string from there.