将SQL Server 2008连接到Microsoft Visual Basic 2010 [英] Connecting SQL Server 2008 to Microsoft Visual Basic 2010
问题描述
美好的一天!
我想征询有关将SQL Server 2008数据库连接到Visual Basic 2010中开发的项目所需的语法的建议.这将是我第一次使用上述应用程序来开发本论文的注册系统.因此,我对如何连接数据库和项目一无所知.
除了将两者连接所需的代码之外,如果有人可以在添加,保存和删除Visual Basic 2010中的SQL Server 2008数据库中的记录时为我提供语法,这也将提供很大的帮助. >
谢谢.
Good day!
I would like to ask for advice regarding the syntax needed to connect a SQL server 2008 database to a project developed in visual basic 2010. It would be the first time I would use the aforementioned applications in order to develop an enrollment system for our thesis. As such, I am at a lost as to how I''ll be able to connect my database and project.
Aside from the codes needed to connect the two, it would also be a great help if someone can provide me with the syntax when it comes to adding, saving, and deleting records in an SQL Server 2008 database in Visual Basic 2010.
Thanks.
推荐答案
您需要创建一个 ^ ]对象,然后使用该对象.链接中有描述,以及一些涵盖常规任务(例如您所需的任务)的示例.
您可以通过在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.
这篇关于将SQL Server 2008连接到Microsoft Visual Basic 2010的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!