我想将Sql Server与Visual Studio 2010连接 [英] I want to connect Sql Server with Visual Studio 2010

查看:101
本文介绍了我想将Sql Server与Visual Studio 2010连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我是初学者学习Vb.net。我有一个项目库系统。我想将数据从Sql server 2008连接到带有数据的Visual Studio 2010

gird view我想使用Insert Update Delete也可以使用按钮,任何人都可以帮助我吗?

Hello I am Beginner learning Vb.net. I have one project Library System.I want to connect data from Sql server 2008 to Visual Studio 2010 with data
gird view and I want to use Insert Update Delete by using button also, Can anyone help me?

推荐答案

首先,您需要使用SQL Server中存在的数据库的连接字符串。捕获后,您可以在创建 SqlConnection [ ^ ]对象实例,以便代码使用该数据库在其上执行不同的命令集。



我写过一篇文章 [ ^ ]描述了将SQL Server数据库连接到.NET应用程序的几个方面(遗憾的是,这是用C#编写的,你可以转换代码来自使用 Telerik转换器 [ ^ ])然后您就可以使用 SqlCommand [ ^ ]执行不同命令的对象,如SELECT,INSERT INTO等。其余的东西,比如GridView和Button事件都与你的框架有关,而且与SQL没有任何关系,这就是为什么我要把它留给你检查这些对象及其事件的MSDN(取决于你的框架,例如WPF或Win表格等。)
First thing is that you need to use the connecting string of your database that is present inside the SQL Server. Once that has been captured you can use that connection string while creating an SqlConnection[^] object instance so that the code would use that database for executing different command sets on it.

I have written an article[^] that describes a few aspects of connecting the SQL Server database to your .NET application, (sadly that was written in C#, you can convert the code from C# to your VB.NET code using Telerik converter[^]) and you will then be able to use the SqlCommand[^] object to execute different commands, like SELECT, INSERT INTO etc. The remaining stuff like GridView, and Button events are related to your framework and have nothing to do with SQL so that is why I will leave that upto you to check MSDN for these objects and their events (depending on your framework e.g. WPF or Win Forms etc).


这篇关于我想将Sql Server与Visual Studio 2010连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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