帮我看看这个错误是什么原因?
日期:2006-05-22 荐:
帮我看看这个错误是什么原因?代码如下 Dim paixu As String = Trim(e.SortExpression) Dim shang As Integer = Session("shang") Dim xia As Integer = Session("xia") Dim dt As DataTable = gettable("select * from fenye where id >= '" & xia & "' and id <= '" & shang & "' ") dt.DefaultView.Sort = "'" & paixu & "' desc" fen.DataSource = dt.DefaultView fen.DataBind()出错语句 dt.DefaultView.Sort = "'" & paixu & "' desc"出错信息 找不到相应的列 (比如sex)当我把'" & paixu & "' 换成对应的列(比如sex)就好了这是什么原因啊dt.DefaultView.Sort = paixu & " desc"'不要加',直接使用字段名 ASC|DESC出错语句 dt.DefaultView.Sort = "'" & paixu & "' desc"--------------改为dt.DefaultView.Sort = paixu & " desc"
标签: