SQL链接数据库
Standard Security:
"Data Source=Aron1;Initial
Catalog=pubs;User Id=sa;Password=asdasd;"
- or -
"Server=Aron1;Database=pubs;User
ID=sa;Password=asdasd;Trusted_Connection=False"
(both
connection strings produces the same result)
Trusted Connection:
"Data
Source=Aron1;Initial Catalog=pubs;Integrated Security=SSPI;"
- or -
"Server=Aron1;Database=pubs;Trusted_Connection=True;"
(both connection strings produces the same result)
(use serverName\instanceName as Data Source to use
an specifik SQLServer instance)
Connect via an IP
address:
"Data Source=190.190.200.100,1433;Network
Library=DBMSSOCN;Initial Catalog=pubs;User ID=sa;Password=asdasd;"
(DBMSSOCN=TCP/IP instead of Named Pipes, at the end of the
Data Source is the port to use (1433 is the default))
Enabling MARS (multiple active result sets):
"Server=Aron1;Database=pubs;Trusted_Connection=True;MultipleActiveResultSets=true"
Note! Use &nbs
相关文档:
create PROCEDURE pagelist
@tablename nvarchar(50),
@fieldname nvarchar(50)='*',
@pagesize int output,--每页显示记录条数
@currentpage int output,--第几页
@orderid nvarchar(50),--主键排序
@sort int,--排序方式,1表示升序,0表示降序排列
......
SQL server安装时报挂起错误
SQL server安装时时:“以前的某个程序安装已在安装计算机上创建挂起的文件操作。运行安装程序之前必须重新启动计算机”错误。 打开注册表编辑器(开始->运行->regedit),在HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager中找到PendingFileRenameOperations项目,并删 ......
use Tempdb
go
if object_ID ( 'fn_ACITEncryption' ) is not null
drop function fn_ACITEncryption
go
create function fn_ACITEncryption
(
@Str nvarchar ( 4000), -- 加密的字符串
@Flag bit = 1, --1 、加密 0 、解密
@Key nvarchar ( 50) -- 密文
)
returns nvarchar ( 4000) ......
我们的SQL语句的执行都是由一个类来完成的!这个类就是SQLStatement,这个类就是我们用来执行SQL语句的类,该类的使用也是非常简单的,我们只需要记住两个属性两个方法。我们来看一下!
text属性:所要执行的SQL语句,该属性是一个字符串格式,所以我们的SQL语句都是字符串!
sqlConnection属性:该属性是设置SQLSt ......