如何连接到Sql Server 2008数据库 [英] How Do I Connect To Sql Server 2008 Database

查看:70
本文介绍了如何连接到Sql Server 2008数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



请我刚刚​​安装了sql server 2008,但我不知道如何将它集成到asp.net(visual studio 2010)。以前,我只使用访问数据库的小应用程序,但现在我想开发一个商业网站,我显然需要升级。与访问数据库,连接所有我做的是使用连接字符串,然后打开连接,然后我可以继续选择,更新或做任何其他事情。即,我使用



OleDbConnection con = new OleDbConnection(Provider = microsoft.JET.OLeDb; Datasource:。\\。



我如何使用sql server 2008做这个。

非常感谢。



chidi


please i just recently installed sql server 2008 but i don't know how to integrate it into asp.net(visual studio 2010). previously, i used access database just for small apps, but now i want to develop a commercial website and i will obviously need to upgrade. with access database, to connect all i did is use the connection string and then open the connection before i can proceed to select, update or do any other thing. i.e, i used

OleDbConnection con = new OleDbConnection("Provider=microsoft.JET.OLeDb; Datasource:.\\."

how do i do this with sql server 2008 please.
thank you very much.

chidi

推荐答案

参考: ASP.NET Web应用程序的SQL Server连接字符串 [ ^ ]


请参考链接 [ ^ ]它将清除您对ADO.net的基本信息
Please refer this link[^]it will clear your basic under standing of ADO.net


您可以将提供程序用作SQL Server的.NET Framework数据提供程序 r



数据源= ServerName \ SQL2008;初始目录= databaseName;用户ID = sa;密码= ****
you can use provider as ".NET Framework Data Provider for SQL Server"
And
Data Source=ServerName\SQL2008;Initial Catalog=databaseName;User ID=sa;Password=****

这篇关于如何连接到Sql Server 2008数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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