if you use ODBC, you need to use ODBC.NET, suggest you create a SQL authenticated account in SQL Server, then use
"Server=localhost;Database=YourDBName;UID=YourUID;PWD=YourPassword;" and classes in System.Data.SqlClient namespace
"Server=localhost;Database=YourDBName;UID=YourUID;PWD=YourPassword;" and classes in System.Data.SqlClient namespace
解决方案 »
- 获取所有新闻问题
- js取到radio的ID后如何再根据ID查询相关信息
- Failed to translate IP address + Hostname to Site Id
- 如何连接sql
- !win2003 sp2 设置文件夹权限的时候总是卡住不动,好像不允许设置一样,求救!
- 在IE上显示mht文件的Response.ContentType = "message/rfc822"问题
- asp/asp.net下运行exe文件出现的一个奇怪问题
- 为什么会出现 “不重新发送信息,则无法刷新网页,请按 重试 再次发送信息”
- 制作asp.net安装程序时时怎样把sql server数据库的数据文件一起打包
- vs.net2003的QuickStart装在哪个目录?如何安装?
- 请教微软专家,有关string转byte[]的"bug"(???)!
- DW MX中无法显示<asp:button/> web控件???
声明using System.Data.SqlClient;
连接
SqlConnection myConnection = new SqlConnection("server=(local);database=你的库名;user id =sa;password=;");
server=192.168.0.250;database=violation;user id=sa;password=;
"DSN=ODBCNAME;UID=sa;PWD=sa"
若使用的是ASP.NET的话,使用OLEDB进行连接的连接串是
"Data Source=ServerName(or IP address);Provider=SQLOLEDB;User ID=sa;Password=sa;"