公司做了个项目,用asp.net1.1(C#)+Sql2000开发。分层做的。错误信息:“/Web”应用程序中的服务器错误。
--------------------------------------------------------------------------------第 1 行: 'c' 附近有语法错误。第 1 行: 'c' 附近有语法错误。游标未声明。 sp_cursorfetch: 所提供的游标标识符值(0)无效。 sp_cursorclose: 所提供的游标标识符值(0)无效。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.Exception: 第 1 行: 'c' 附近有语法错误。第 1 行: 'c' 附近有语法错误。游标未声明。 sp_cursorfetch: 所提供的游标标识符值(0)无效。 sp_cursorclose: 所提供的游标标识符值(0)无效。源错误:
行 490: catch(System.Data.SqlClient.SqlException ex)
行 491: {
行 492: throw new Exception(ex.Message);
行 493: }
行 494: finally
源文件: E:\www.syinfo.com.cn\SqlDAL\DbHelperSQL.cs 行: 492 堆栈跟踪:
[Exception: 第 1 行: 'c' 附近有语法错误。
第 1 行: 'c' 附近有语法错误。
游标未声明。
sp_cursorfetch: 所提供的游标标识符值(0)无效。
sp_cursorclose: 所提供的游标标识符值(0)无效。]
syinfo.SqlDAL.DbHelperSQL.RunProcedure(String storedProcName, IDataParameter[] parameters, String tableName) in E:\www.syinfo.com.cn\SqlDAL\DbHelperSQL.cs:492
syinfo.Web.admin.news.createlist.GetCommanNews(Int32 objectid, Int32 type, Int32 isimage, Int32 newstype, String condition, String sort, Int32 pageindex) in e:\www.syinfo.com.cn\web\admin\news\createlist.aspx.cs:273
syinfo.Web.admin.news.createlist.GetLoopText(String replacetext, String order, Int32 type, Int32 index, String property, Int32 isimage, Int32 num, Int32 parentid, Int32 parenttype, Int32 newstype) in e:\www.syinfo.com.cn\web\admin\news\createlist.aspx.cs:1249
syinfo.Web.admin.news.createlist.GetReplacedString(String htmltext, String linkinfo, Int32 objectid, Int32 type) in e:\www.syinfo.com.cn\web\admin\news\createlist.aspx.cs:1062
syinfo.Web.admin.news.createlist.IsCreateCommanList(Int32 objectid, Int32 type, String htmltext, String path, String linkinfo, Encoding code) in e:\www.syinfo.com.cn\web\admin\news\createlist.aspx.cs:641
syinfo.Web.admin.news.createlist.IsCreateList(Int32 objectid, Int32 type, String path, DateTime time, Int32 templetid, String keywords, String metainfo) in e:\www.syinfo.com.cn\web\admin\news\createlist.aspx.cs:537
syinfo.Web.admin.news.createlist.Create_Click(Object sender, EventArgs e) in e:\www.syinfo.com.cn\web\admin\news\createlist.aspx.cs:105
System.Web.UI.WebControls.LinkButton.OnClick(EventArgs e) +108
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +138
System.Web.UI.Page.ProcessRequestMain() +1292 各位大虾帮个忙啦!
--------------------------------------------------------------------------------第 1 行: 'c' 附近有语法错误。第 1 行: 'c' 附近有语法错误。游标未声明。 sp_cursorfetch: 所提供的游标标识符值(0)无效。 sp_cursorclose: 所提供的游标标识符值(0)无效。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.Exception: 第 1 行: 'c' 附近有语法错误。第 1 行: 'c' 附近有语法错误。游标未声明。 sp_cursorfetch: 所提供的游标标识符值(0)无效。 sp_cursorclose: 所提供的游标标识符值(0)无效。源错误:
行 490: catch(System.Data.SqlClient.SqlException ex)
行 491: {
行 492: throw new Exception(ex.Message);
行 493: }
行 494: finally
源文件: E:\www.syinfo.com.cn\SqlDAL\DbHelperSQL.cs 行: 492 堆栈跟踪:
[Exception: 第 1 行: 'c' 附近有语法错误。
第 1 行: 'c' 附近有语法错误。
游标未声明。
sp_cursorfetch: 所提供的游标标识符值(0)无效。
sp_cursorclose: 所提供的游标标识符值(0)无效。]
syinfo.SqlDAL.DbHelperSQL.RunProcedure(String storedProcName, IDataParameter[] parameters, String tableName) in E:\www.syinfo.com.cn\SqlDAL\DbHelperSQL.cs:492
syinfo.Web.admin.news.createlist.GetCommanNews(Int32 objectid, Int32 type, Int32 isimage, Int32 newstype, String condition, String sort, Int32 pageindex) in e:\www.syinfo.com.cn\web\admin\news\createlist.aspx.cs:273
syinfo.Web.admin.news.createlist.GetLoopText(String replacetext, String order, Int32 type, Int32 index, String property, Int32 isimage, Int32 num, Int32 parentid, Int32 parenttype, Int32 newstype) in e:\www.syinfo.com.cn\web\admin\news\createlist.aspx.cs:1249
syinfo.Web.admin.news.createlist.GetReplacedString(String htmltext, String linkinfo, Int32 objectid, Int32 type) in e:\www.syinfo.com.cn\web\admin\news\createlist.aspx.cs:1062
syinfo.Web.admin.news.createlist.IsCreateCommanList(Int32 objectid, Int32 type, String htmltext, String path, String linkinfo, Encoding code) in e:\www.syinfo.com.cn\web\admin\news\createlist.aspx.cs:641
syinfo.Web.admin.news.createlist.IsCreateList(Int32 objectid, Int32 type, String path, DateTime time, Int32 templetid, String keywords, String metainfo) in e:\www.syinfo.com.cn\web\admin\news\createlist.aspx.cs:537
syinfo.Web.admin.news.createlist.Create_Click(Object sender, EventArgs e) in e:\www.syinfo.com.cn\web\admin\news\createlist.aspx.cs:105
System.Web.UI.WebControls.LinkButton.OnClick(EventArgs e) +108
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +138
System.Web.UI.Page.ProcessRequestMain() +1292 各位大虾帮个忙啦!
(@objectid int,
@type int,
@isimage int,
@newstype int,
@sort varchar(500),
@condition varchar(150),
@PageCurrent int
)/*@newstype 是新闻0还是专题1*/
AS
begin
declare @sql varchar(3000)
set @sql=''
if(@objectid=0) begin
if(@isimage=0)
begin
set @sql=@sql+'select new_fulltitle,new_path,new_title,NEW_AddDate,new_subtitle,new_intro,CON_Text= '''' from '
set @sql=@sql+' SyInfo_News '
set @sql=@sql+' where new_isauditing=1 and NEW_ImageNewsPicID=0 '
end
else if(@isimage=1)
begin
set @sql=@sql+'select new_fulltitle ,pi_path,new_path,new_title,NEW_AddDate,new_subtitle,new_intro,CON_Text= '''' from '
set @sql=@sql+' SyInfo_News,syinfo_pic_info '
set @sql=@sql+' where NEW_IsImgNews=1 and NEW_ImageNewsPicID=PI_ID and new_isauditing=1 '
end
else
begin
set @sql=@sql+'select new_fulltitle ,new_path,new_title,NEW_AddDate,new_subtitle,new_intro,CON_Text= '''' from '
set @sql=@sql+' SyInfo_News '
set @sql=@sql+' where NEW_IsImgNews=1 '
end
end
else begin
if(@type=1)/*栏目*/
begin
if(@newstype=0)/*新闻*/
begin
if(@isimage=1)/*picnews*/
begin
set @sql=@sql+' select PI_Path,new_fulltitle,new_path,new_title,NEW_AddDate,new_subtitle,new_intro,'
set @sql=@sql+' (select top 1 con_text from syinfo_content where con_object_id=new_id and con_list_id=1'
set @sql=@sql+' and con_isauditing=1 order by con_time desc) '
set @sql=@sql+' as CON_Text'
set @sql=@sql+' from SyInfo_Pic_Info , SyInfo_News '
set @sql=@sql+' where NEW_IsImgNews=1 and NEW_ImageNewsPicID=PI_ID and new_isauditing=1 and NEW_MenuID='
set @sql=@sql+ cast(@objectid as varchar(10))
end
else if (@isimage=2)/* picnews and commantext*/
begin
set @sql=@sql+'select new_fulltitle,new_path,new_title,NEW_AddDate,new_subtitle,new_intro,'
set @sql=@sql+'(select top 1 con_text from syinfo_content where con_object_id=new_id and con_list_id=1'
set @sql=@sql+' and con_isauditing=1 order by con_time desc) as CON_Text '
set @sql=@sql+' from SyInfo_News where new_isauditing=1 and NEW_MenuID='
set @sql=@sql+ cast(@objectid as varchar(10))
end
else
begin
set @sql=@sql+'select new_fulltitle,new_path,new_title,NEW_AddDate,new_subtitle,new_intro,'
set @sql=@sql+'(select top 1 con_text from syinfo_content where con_object_id=new_id and con_list_id=1'
set @sql=@sql+' and con_isauditing=1 order by con_time desc) as CON_Text '
set @sql=@sql+' from SyInfo_News where NEW_IsImgNews=0 and new_isauditing=1 and NEW_MenuID='
set @sql=@sql+ cast(@objectid as varchar(10))
end
end
end
else/*频道*/
begin
if(@newstype=0)/*新闻*/
begin
if(@isimage=1)
begin
set @sql=@sql+'select PI_Path,new_fulltitle,new_path,new_title,NEW_AddDate,new_subtitle,new_intro,'
set @sql=@sql+'(select top 1 con_text from syinfo_content where con_object_id=new_id and con_list_id=1'
set @sql=@sql+' and con_isauditing=1 order by con_time desc) as CON_Text '
set @sql=@sql+' from SyInfo_Pic_Info , SyInfo_News '
set @sql=@sql+' where NEW_IsImgNews=1 and new_isauditing=1 and NEW_ImageNewsPicID=PI_ID and NEW_ChanleID='+cast(@objectid as varchar(10))
set @sql=@sql+' and new_isauditing=1'
end
else if (@isimage=2)/* picnews and commantext*/
begin
set @sql=@sql+'select new_fulltitle,new_path,new_title,NEW_AddDate,new_subtitle,new_intro,'
set @sql=@sql+'(select top 1 con_text from syinfo_content where con_object_id=new_id and con_list_id=1'
set @sql=@sql+' and con_isauditing=1 order by con_time desc) as CON_Text '
set @sql=@sql+' from SyInfo_News where new_isauditing=1 and NEW_ChanleID='
set @sql=@sql+ cast(@objectid as varchar(10))
end
else
begin
set @sql=@sql+' select new_fulltitle,new_path,new_title,NEW_AddDate,new_subtitle,new_intro,'
set @sql=@sql+'(select top 1 con_text from syinfo_content where con_object_id=new_id and con_list_id=1' set @sql=@sql+' and con_isauditing=1 order by con_time desc) as CON_Text '
set @sql=@sql+' from SyInfo_News '
set @sql=@sql+' where NEW_IsImgNews=0 and new_isauditing=1 and NEW_ChanleID='+cast(@objectid as varchar(10))
set @sql=@sql+' and new_isauditing=1'
end
end
else/*专题*/
begin
if(@isimage=1)
begin
set @sql=@sql+'select PI_Path,SI_Path,SI_Title,SI_SortTitle,SI_AddTime,SI_Intro,'
set @sql=@sql+'(select top 1 con_text from syinfo_content where con_object_id=si_id and con_list_id=3'
set @sql=@sql+' and con_isauditing=1 order by con_time desc) as CON_Text '
set @sql=@sql+' from SyInfo_Pic_Info , SyInfo_SpecialInfo '
set @sql=@sql+' where SI_IsPicSpecial=1 and SI_BreviaryPicID=PI_ID and SI_ChanleID='+cast(@objectid as varchar(10))
end
else if (@isimage=2)/* picnews and commantext*/
begin
set @sql=@sql+'select SI_Path,SI_Title,SI_SortTitle,SI_AddTime,SI_Intro,'
set @sql=@sql+'(select top 1 con_text from syinfo_content where con_object_id=si_id and con_list_id=3'
set @sql=@sql+' and con_isauditing=1 order by con_time desc) as CON_Text '
set @sql=@sql+' from SyInfo_SpecialInfo '
set @sql=@sql+' where SI_ChanleID='+cast(@objectid as varchar(10))
end
else
begin
set @sql=@sql+'select SI_Path,SI_Title,SI_SortTitle,SI_AddTime,SI_Intro,'
set @sql=@sql+'(select top 1 con_text from syinfo_content where con_object_id=si_id and con_list_id=3'
set @sql=@sql+' and con_isauditing=1 order by con_time desc) as CON_Text '
set @sql=@sql+' from SyInfo_SpecialInfo '
set @sql=@sql+' where SI_IsPicSpecial=0 and SI_ChanleID='+cast(@objectid as varchar(10))
end
end
end
end
if @condition<>''
set @sql=@sql+@condition
else
set @sql=@sql
if @sort<>''
set @sql=@sql+@sort
else
set @sql=@sql
exec (@sql)
declare @PageCount int
exec sp_PageView @sql,@PageCurrent,18,@PageCount=@PageCount out
SELECT @PageCount
end
RETURN
GO