[SqlException: 用户 'sa' 登录失败。原因: 未与信任 SQL Server 连接相关联。]
System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction)
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction)
System.Data.SqlClient.SqlConnection.Open()
Sutra.Config.Open() in C:\Inetpub\wwwroot\Sutra\Components\Config.cs:38
Sutra.Config.GetRsCount(String table_name) in C:\Inetpub\wwwroot\Sutra\Components\Config.cs:376
Sutra.Default.btn_Sure_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\sutra\default.aspx.cs:95
System.Web.UI.WebControls.Button.OnClick(EventArgs e)
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()
--------------------------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:1.1.4322.573; ASP.NET 版本:1.1.4322.573
CREATE procedure s_Page_Rise
(
@pagesize int,
@pageindex int,
@Filed varchar(200),
@table varchar(200)
)
as
set nocount on
create table #indextable (id int identity(1,1),nid int)
declare @PageLowerBound int
declare @PageUpperBound int
set @PageLowerBound=(@pageindex-1)*@pagesize
set @PageUpperBound=@PageLowerBound+@pagesize
set rowcount @PageUpperBound
exec ('insert #indextable (nid) select id from '+@table+' order by id')
declare @a varchar(8000)
set @a='select '+@Filed+' from '+@table+' O,#indextable t where O.id=t.nid and t.id>'+cast(@PageLowerBound as varchar(10))+' and t.id<='+cast(@PageUpperBound as varchar(10))+' order by t.id'
exec(@a)
set nocount off
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS OFF
GO
CREATE procedure s_Page_Rise_Where
(
@pagesize int,
@pageindex int,
@Filed varchar(100),
@table varchar(50),
@where varchar(500)
)
as
set nocount on
create table #indextable (id int identity(1,1),nid int)
declare @PageLowerBound int
declare @PageUpperBound int
set @PageLowerBound=(@pageindex-1)*@pagesize
set @PageUpperBound=@PageLowerBound+@pagesize
set rowcount @PageUpperBound
exec ('insert #indextable (nid) select ID from '+@table+' where '+@where+' order by ID')
declare @a varchar(8000)
set @a='select '+@Filed+' from '+@table+' O,#indextable t where O.ID=t.nid and t.id>'+cast(@PageLowerBound as varchar(10))+' and t.id<='+cast(@PageUpperBound as varchar(10))+' order by t.id'
exec(@a)
set nocount off
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS OFF
GO
CREATE procedure s_Page_Where
(
@pagesize int,
@pageindex int,
@Filed varchar(100),
@table varchar(50),
@where varchar(500)
)
as
set nocount on
create table #indextable (id int identity(1,1),nid int)
declare @PageLowerBound int
declare @PageUpperBound int
set @PageLowerBound=(@pageindex-1)*@pagesize
set @PageUpperBound=@PageLowerBound+@pagesize
set rowcount @PageUpperBound
exec ('insert #indextable (nid) select ID from '+@table+' where '+@where+' order by ID desc')
declare @a varchar(8000)
set @a='select '+@Filed+' from '+@table+' O,#indextable t where O.ID=t.nid and t.id>'+cast(@PageLowerBound as varchar(10))+' and t.id<='+cast(@PageUpperBound as varchar(10))+' order by t.id desc'
exec(@a)
set nocount off
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS OFF
GO
CREATE proc s_Restoredbase
@dbase varchar(25),
@fileName nvarchar(100)
AS
Declare @spid char(3)
Declare Cu_A cursor for
SELECT spid FROM master..sysprocesses where Spid>12 and Spid<>@@SPID
OPEN Cu_A
Fetch CU_A into @spid
While @@fetch_status=0
Begin
Exec('kill '+@spid)
Fetch CU_A into @spid
End
Close Cu_A
Deallocate Cu_A
RESTORE DATABASE @dbase FROM DISK = @fileName
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS OFF
GO
CREATE PROCEDURE s_Sun
@sql varchar(100)
as
exec(@sql)
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
insert into t_User(Name,Sex,Limit_Code,User_Id,Password) values('高处不胜寒','男','A','wufeng','wufeng')
insert into t_Limit(Name,Code) values('高级管理员','A')
insert into t_Limit(Name,Code) values('信息维护权','B')
insert into t_Sys(id,css,MainTopImg,LogonImg) values(1,'Blue.css','tp.jpg','Login.gif')
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[s_Del]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[s_Del]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[s_Detail]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[s_Detail]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[s_Page]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[s_Page]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[s_Page_Rise]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[s_Page_Rise]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[s_Page_Rise_Where]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[s_Page_Rise_Where]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[s_Page_Where]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[s_Page_Where]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[s_Restoredbase]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[s_Restoredbase]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[s_Sun]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[s_Sun]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[v_Message_User]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[v_Message_User]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[T_Limit]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[T_Limit]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[T_User]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[T_User]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[t_Message]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[t_Message]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[t_Sys]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[t_Sys]
GO
ALTER TABLE [dbo].[T_User] WITH NOCHECK ADD
CONSTRAINT [PK_T_User] PRIMARY KEY CLUSTERED
(
[Id]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[t_Message] WITH NOCHECK ADD
CONSTRAINT [PK_t_Message] PRIMARY KEY CLUSTERED
(
[id]
) ON [PRIMARY]
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE VIEW dbo.v_Message_User
AS
SELECT dbo.t_Message.Content, dbo.t_Message.Title, dbo.t_Message.id,
dbo.T_User.Name AS User_Name, dbo.t_Message.Input_Date
FROM dbo.t_Message INNER JOIN
dbo.T_User ON dbo.t_Message.User_Id = dbo.T_User.Id
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS OFF
GO
CREATE PROCEDURE s_Del
@table varchar(200),
@where varchar(200)
AS
exec ('delete from '+@table+' where '+@where)
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS OFF
GO
CREATE PROCEDURE s_Detail
@fileds varchar(200),
@table varchar(200)
as
exec ('select '+@fileds+' from '+@table)
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS OFF
GO
CREATE procedure s_Page
(
@pagesize int,
@pageindex int,
@Filed varchar(200),
@table varchar(200)
)
as
set nocount on
create table #indextable (id int identity(1,1),nid int)
declare @PageLowerBound int
declare @PageUpperBound int
set @PageLowerBound=(@pageindex-1)*@pagesize
set @PageUpperBound=@PageLowerBound+@pagesize
set rowcount @PageUpperBound
exec ('insert #indextable (nid) select id from '+@table+' order by id desc')
declare @a varchar(8000)
set @a='select '+@Filed+' from '+@table+' O,#indextable t where O.id=t.nid and t.id>'+cast(@PageLowerBound as varchar(10))+' and t.id<='+cast(@PageUpperBound as varchar(10))+' order by t.id'
exec(@a)
set nocount off
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO