(老鸟求助)异步线程读取sqlserver数据库的数据老是出错,非常莫

php中文网
发布: 2016-06-07 15:40:00
原创
1383人浏览过

SELECT * FROM ( SELECT M.*, [dbo].[fn_getFullRegionName_M](M.[Workplace]) AS [WorkplaceName], R.[Name], R.[Score], R.[LastModificationTime], UP.[TrueName], UP.[Sex], UP.[Birthday], UP.[HighestDegree], UP.[WorkExperience], ROW_NUMBER() OVER

select * from (
 select m.*, [dbo].[fn_getfullregionname_m](m.[workplace]) as [workplacename], r.[name],
     r.[score], r.[lastmodificationtime], up.[truename], up.[sex], up.[birthday], up.[highestdegree], up.[workexperience], 
        row_number() over(order by r.[lastmodificationtime] desc) as _pos
        from [personal].[jobapplication] m
        left join [personal].[resume] r on r.[resumeid] = m.[resumeid]
        left join [personal].[userprofile] up on up.[resumeid] = m.[resumeid]
        where
        r.[isactived] = 1 and
        r.[fulllevel ] > 1
    ) as sp
    where _pos between (@pageindex-1) * @pagesize + 1 and @pageindex * @pagesize;

 

以上为要执行的语句,出现这样的错误:
System.Threading.ThreadAbortException: 正在中止线程。
   在 SNINativeMethodWrapper.SNIPacketGetConnection(IntPtr packet)
   在 System.Data.SqlClient.TdsParserStateObject.ProcessSniPacket(IntPtr packet, UInt32 error)
   在 System.Data.SqlClient.TdsParserStateObject.ReadSni(DbAsyncResult asyncResult, TdsParserStateObject stateObj)
   在 System.Data.SqlClient.TdsParserStateObject.ReadNetworkPacket()
   在 System.Data.SqlClient.TdsParserStateObject.ReadBuffer()
   在 System.Data.SqlClient.TdsParserStateObject.ReadByteArray(Byte[] buff, Int32 offset, Int32 len)
   在 System.Data.SqlClient.TdsParserStateObject.ReadUInt32()
   在 System.Data.SqlClient.TdsParserStateObject.ReadPlpLength(Boolean returnPlpNullIfNull)
   在 System.Data.SqlClient.TdsParser.ReadPlpUnicodeChars(Char[]& buff, Int32 offst, Int32 len, TdsParserStateObject stateObj)
   在 System.Data.SqlClient.TdsParser.ReadSqlStringValue(SqlBuffer value, Byte type, Int32 length, Encoding encoding, Boolean isPlp, TdsParserStateObject stateObj)
   在 System.Data.SqlClient.TdsParser.ReadSqlValue(SqlBuffer value, SqlMetaDataPriv md, Int32 length, TdsParserStateObject stateObj)
   在 System.Data.SqlClient.SqlDataReader.ReadColumnData()
   在 System.Data.SqlClient.SqlDataReader.ReadColumn(Int32 i, Boolean setTimeout)
   在 System.Data.SqlClient.SqlDataReader.GetValueInternal(Int32 i)
   在 System.Data.SqlClient.SqlDataReader.GetValue(Int32 i)
   在 ZM.PH.MyLucene.FullIndexer.BeginLoadData() 位置 G:\ProgrammerHelper\PHSolution\MyLucene\Indexer\FullIndexer.cs:行号 88

运行环境:windows2003,iis6,asp.net .net framework 3.5。

奇怪的是,我在本地用winform程序调用该组件访问数据却从没来没有出错过(异步),可以排除程序本身的问题。

Dreamina
Dreamina

字节跳动推出的AI绘画工具,用简单的文案创作精美的图片

Dreamina 436
查看详情 Dreamina

本人在行内也呆了近七八年了,从未见过这样的错误,调试时发现出错的字段不尽相同,应该不是由于某一字段数据有问题造成。

有经验的同志帮忙看一下,谢了!

相关标签:
最佳 Windows 性能的顶级免费优化软件
最佳 Windows 性能的顶级免费优化软件

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号