我想按文章标题对我的网格视图进行排序,下拉列表如下图所示。我将我的网格视图连接到 dataSqlsouce。但它给了我这个错误:将 nvarchar 值“XX”转换为数据类型 int 时转换失败。
我在 datasqlsource 中的 Sql 代码是:
SELECT addtitle.title,
submitmanuscript.status,
addarticletype.type,
addarticletype.username AS Expr1,
addarticletype.articletype,
submitmanuscript.date,
submitmanuscript.articlenum,
addarticletype.articleid,
CONVERT (VARCHAR(10), submitmanuscript.date, 103) AS date1,
addarticletype.checkfinish,
rolinfo.*
FROM addarticletype
INNER JOIN addtitle
ON addarticletype.articleid = addtitle.articleid
INNER JOIN submitmanuscript
ON addarticletype.articleid = submitmanuscript.articleid
INNER JOIN rolinfo
ON addarticletype.username = rolinfo.username
WHERE ( addarticletype.articleid IN (SELECT articleid
FROM addupload_4 AS AddUpload_4_1
WHERE
( addarticletype.checkfinish = '0' )) )
AND ( addarticletype.type = @Type )
ORDER BY CASE
WHEN @order = 'AddArticleType.ArticleID' THEN addarticletype.articleid
WHEN @order = 'Title' THEN CONVERT(VARCHAR, title)
WHEN @order = 'family' THEN family
WHEN @order = 'AddArticleType.ArticleType' THEN
addarticletype.articletype
END
有谁能够帮我?